Skip to content

Improve Query Result error handling and logging (#18538) #1166

Improve Query Result error handling and logging (#18538)

Improve Query Result error handling and logging (#18538) #1166

GitHub Actions / Unit Test Report succeeded Dec 25, 2024 in 1s

312 passed, 0 failed and 0 skipped

Tests passed successfully

✅ ./test-reports/test-results-ext.xml

312 tests were completed in 2s with 312 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
Azure Controller Tests 5✅ 1ms
Azure SQL client 2✅ 6ms
Code Adapter Tests 6✅ 24ms
Config Tests 1✅ 0ms
Connection Profile tests 9✅ 55ms
Connection UI tests 14✅ 58ms
ConnectionCredentials Tests 9✅ 13ms
Copy Tests 6✅ 21ms
Copy Tests with multiple selections 4✅ 14ms
Credential Store Tests 3✅ 4ms
Decompress Provider Tests 1✅ 1ms
Execution Plan Utilities 10✅ 136ms
ExecutionPlanWebviewController 6✅ 19ms
ExtConfig Tests 8✅ 115ms
Firewall Service Tests 2✅ 4ms
HttpClient Tests 1✅ 1ms
Initialization Tests 1✅ 982ms
Input Prompt Tests 3✅ 11ms
Language Service Tests 0ms
List Prompt Tests 1✅ 0ms
Localization Tests 3✅ 3ms
MainController Tests 12✅ 65ms
Metadata Service Tests 1✅ 17ms
MssqlProtocolHandler Tests 7✅ 6ms
Object Explorer Node Types Test 5✅ 7ms
Object Explorer Provider Tests 12✅ 56ms
Object Explorer Utils Tests 5✅ 5ms
Per File Connection Tests 12✅ 110ms
Platform Tests 20✅ 27ms
Prompts test 8✅ 4ms
Query Runner tests 13✅ 0ms
QueryNotificationHandler tests 3✅ 9ms
ReactWebviewController Tests 17✅ 29ms
ReactWebviewPanelController 9✅ 21ms
Root Suite 0ms
save results tests 10✅ 91ms
Scripting Service Tests 7✅ 25ms
Server Status View Tests 4✅ 303ms
Server tests 6✅ 6ms
Service Client tests 2✅ 3ms
ServiceDownloadProvider Tests 6✅ 10ms
SqlOutputProvider Tests using mocks 16✅ 37ms
Status View Tests 5✅ 2ms
Stub Logger tests 5✅ 2ms
Stub Status View tests 4✅ 1ms
Test Checkbox prompt 3✅ 4ms
Test Confirm Prompt 0ms
Test Expand Prompt 1✅ 8ms
Test Service Installer Util functions 2✅ 12ms
UntitledSqlDocumentService Tests 0ms
UserSurvey Tests 7✅ 15ms
Utility tests - getSignInQuickPickItems 3✅ 2ms
Utility Tests - isSameConnection 5✅ 2ms
Utility Tests - parseNumAsTimeString 1✅ 0ms
Utility Tests - parseTimeString 4✅ 2ms
Utility tests - Timer Class 0ms
Webview Panel Controller Tests 2✅ 3ms

✅ Azure Controller Tests

isTokenInValid should return true for undefined token
  ✅ Azure Controller Tests isTokenInValid should return true for undefined token
isTokenInValid should return true for empty token
  ✅ Azure Controller Tests isTokenInValid should return true for empty token
isTokenInValid should return true for undefined expiresOn
  ✅ Azure Controller Tests isTokenInValid should return true for undefined expiresOn
isTokenInValid should return true for expired token
  ✅ Azure Controller Tests isTokenInValid should return true for expired token
isTokenInValid should return false for valid token
  ✅ Azure Controller Tests isTokenInValid should return false for valid token

✅ Azure SQL client

Should return locations successfully
  ✅ Azure SQL client Should return locations successfully
Should return resource groups successfully
  ✅ Azure SQL client Should return resource groups successfully

✅ Code Adapter Tests

logError should append message to the channel
  ✅ Code Adapter Tests logError should append message to the channel
log should format message and append to the channel
  ✅ Code Adapter Tests log should format message and append to the channel
clearLog should clear from output channel
  ✅ Code Adapter Tests clearLog should clear from output channel
showLog should show the output channel
  ✅ Code Adapter Tests showLog should show the output channel
promptSingle and promptCallback should call prompt
  ✅ Code Adapter Tests promptSingle and promptCallback should call prompt
prompting a checkbox question should call fixQuestion
  ✅ Code Adapter Tests prompting a checkbox question should call fixQuestion

✅ Config Tests

getSqlToolsServiceDownloadUrl should return valid value
  ✅ Config Tests getSqlToolsServiceDownloadUrl should return valid value

✅ Connection Profile tests

CreateProfile should ask questions in correct order
  ✅ Connection Profile tests CreateProfile should ask questions in correct order
CreateProfile - SqlPassword should be default auth type
  ✅ Connection Profile tests CreateProfile - SqlPassword should be default auth type
CreateProfile - Integrated auth support
  ✅ Connection Profile tests CreateProfile - Integrated auth support
Port number is applied to server name when connection credentials are transformed into details
  ✅ Connection Profile tests Port number is applied to server name when connection credentials are transformed into details
All connection details properties can be set from connection credentials
  ✅ Connection Profile tests All connection details properties can be set from connection credentials
Profile is connected to and validated prior to saving
  ✅ Connection Profile tests Profile is connected to and validated prior to saving
Updated Profile is returned when SSL error occurs
  ✅ Connection Profile tests Updated Profile is returned when SSL error occurs
Profile is not saved when connection validation fails
  ✅ Connection Profile tests Profile is not saved when connection validation fails
Profile can be created from a connection string
  ✅ Connection Profile tests Profile can be created from a connection string

✅ Connection UI tests

showConnectionErrors should show errors in the output channel
  ✅ Connection UI tests showConnectionErrors should show errors in the output channel
showConnections with recent and new connection
  ✅ Connection UI tests showConnections with recent and new connection
showConnections with recent and edit connection
  ✅ Connection UI tests showConnections with recent and edit connection
showConnections with recent but no selection
  ✅ Connection UI tests showConnections with recent but no selection
promptLanguageFlavor should prompt for a language flavor
  ✅ Connection UI tests promptLanguageFlavor should prompt for a language flavor
promptToCancelConnection should prompt for cancellation
  ✅ Connection UI tests promptToCancelConnection should prompt for cancellation
promptForPassword should prompt for password
  ✅ Connection UI tests promptForPassword should prompt for password
promptToChangeLanguageMode should prompt for language mode - selection
  ✅ Connection UI tests promptToChangeLanguageMode should prompt for language mode - selection
promptToChangeLanguageMode should prompt for language mode - no selection
  ✅ Connection UI tests promptToChangeLanguageMode should prompt for language mode - no selection
removeProfile should prompt for a profile and remove it
  ✅ Connection UI tests removeProfile should prompt for a profile and remove it
removeProfile should show error if there are no profiles to remove
  ✅ Connection UI tests removeProfile should show error if there are no profiles to remove
promptToManageProfiles should prompt to manage profile
  ✅ Connection UI tests promptToManageProfiles should prompt to manage profile
promptForRetryCreateProfile should show an error message and create profile
  ✅ Connection UI tests promptForRetryCreateProfile should show an error message and create profile
createProfileWithDifferentCredentials should prompt to recreate connection
  ✅ Connection UI tests createProfileWithDifferentCredentials should prompt to recreate connection

✅ ConnectionCredentials Tests

ensureRequiredPropertiesSet should remove password from plain text and save password to Credential Store
  ✅ ConnectionCredentials Tests ensureRequiredPropertiesSet should remove password from plain text and save password to Credential Store
ensureRequiredPropertiesSet should keep Credential Store password
  ✅ ConnectionCredentials Tests ensureRequiredPropertiesSet should keep Credential Store password
ensureRequiredPropertiesSet should not save password
  ✅ ConnectionCredentials Tests ensureRequiredPropertiesSet should not save password
ensureRequiredPropertiesSet should not save password, empty password case
  ✅ ConnectionCredentials Tests ensureRequiredPropertiesSet should not save password, empty password case
ensureRequiredPropertiesSet should request password and save it for non-empty passwords
  ✅ ConnectionCredentials Tests ensureRequiredPropertiesSet should request password and save it for non-empty passwords
ensureRequiredPropertiesSet should request password and save it correctly for empty passswords
  ✅ ConnectionCredentials Tests ensureRequiredPropertiesSet should request password and save it correctly for empty passswords
createConnectionDetails sets properties in addition to the connection string
  ✅ ConnectionCredentials Tests createConnectionDetails sets properties in addition to the connection string
Subsequent connection credential questions are skipped if a connection string is given
  ✅ ConnectionCredentials Tests Subsequent connection credential questions are skipped if a connection string is given
Server question properly handles connection strings
  ✅ ConnectionCredentials Tests Server question properly handles connection strings

✅ Copy Tests

Correctly copy pastes a selection
  ✅ Query Runner tests Copy Tests Correctly copy pastes a selection
Copies selection with column headers set in user config
  ✅ Query Runner tests Copy Tests Copies selection with column headers set in user config
Copies selection with headers when true passed as parameter
  ✅ Query Runner tests Copy Tests Copies selection with headers when true passed as parameter
Copies selection without headers when false passed as parameter
  ✅ Query Runner tests Copy Tests Copies selection without headers when false passed as parameter
SetEditorSelection uses an existing editor if it is visible
  ✅ Query Runner tests Copy Tests SetEditorSelection uses an existing editor if it is visible
SetEditorSelection uses column 1 by default
  ✅ Query Runner tests Copy Tests SetEditorSelection uses column 1 by default

✅ Copy Tests with multiple selections

Correctly copy pastes a selection
  ✅ Query Runner tests Copy Tests with multiple selections Correctly copy pastes a selection
Copies selection with column headers set in user config
  ✅ Query Runner tests Copy Tests with multiple selections Copies selection with column headers set in user config
Copies selection with headers when true passed as parameter
  ✅ Query Runner tests Copy Tests with multiple selections Copies selection with headers when true passed as parameter
Copies selection without headers when false passed as parameter
  ✅ Query Runner tests Copy Tests with multiple selections Copies selection without headers when false passed as parameter

✅ Credential Store Tests

Read credential should send a ReadCredentialRequest
  ✅ Credential Store Tests Read credential should send a ReadCredentialRequest
Save credential should send a SaveCredentialRequest
  ✅ Credential Store Tests Save credential should send a SaveCredentialRequest
Delete credential should send a DeleteCredentialRequest
  ✅ Credential Store Tests Delete credential should send a DeleteCredentialRequest

✅ Decompress Provider Tests

Decompress package test
  ✅ Language Service Tests Decompress Provider Tests Decompress package test

✅ Execution Plan Utilities

saveExecutionPlan: should call saveExecutionPlan and return the state
  ✅ Execution Plan Utilities saveExecutionPlan: should call saveExecutionPlan and return the state
showXml: should call showXml and return the state
  ✅ Execution Plan Utilities showXml: should call showXml and return the state
showQuery: should call newQuery with the correct query and return the state
  ✅ Execution Plan Utilities showQuery: should call newQuery with the correct query and return the state
createExecutionPlanGraphs: should create executionPlanGraphs correctly and return the state
  ✅ Execution Plan Utilities createExecutionPlanGraphs: should create executionPlanGraphs correctly and return the state
createExecutionPlanGraphs: should register error and update the state
  ✅ Execution Plan Utilities createExecutionPlanGraphs: should register error and update the state
updateTotalCost: should call updateTotalCost with the added cost and return the updated state
  ✅ Execution Plan Utilities updateTotalCost: should call updateTotalCost with the added cost and return the updated state
calculateTotalCost: should return 0 and set loadState to Error if executionPlanGraphs is undefined
  ✅ Execution Plan Utilities calculateTotalCost: should return 0 and set loadState to Error if executionPlanGraphs is undefined
calculateTotalCost: should correctly calculate the total cost for a valid state
  ✅ Execution Plan Utilities calculateTotalCost: should correctly calculate the total cost for a valid state
calculateTotalCost: should return 0 if executionPlanGraphs is empty
  ✅ Execution Plan Utilities calculateTotalCost: should return 0 if executionPlanGraphs is empty
formatXml: should return original xml contents if it is not a valid xml file
  ✅ Execution Plan Utilities formatXml: should return original xml contents if it is not a valid xml file

✅ ExecutionPlanWebviewController

should initialize with correct state and webview title
  ✅ ExecutionPlanWebviewController should initialize with correct state and webview title
should call createExecutionPlanGraphs in getExecutionPlan reducer
  ✅ ExecutionPlanWebviewController should call createExecutionPlanGraphs in getExecutionPlan reducer
should call saveExecutionPlan in saveExecutionPlan reducer
  ✅ ExecutionPlanWebviewController should call saveExecutionPlan in saveExecutionPlan reducer
should call showPlanXml in showPlanXml reducer
  ✅ ExecutionPlanWebviewController should call showPlanXml in showPlanXml reducer
should call showQuery in showQuery reducer
  ✅ ExecutionPlanWebviewController should call showQuery in showQuery reducer
should call updateTotalCost in updateTotalCost reducer
  ✅ ExecutionPlanWebviewController should call updateTotalCost in updateTotalCost reducer

✅ ExtConfig Tests

getSqlToolsServiceDownloadUrl should return value from extension config first
  ✅ ExtConfig Tests getSqlToolsServiceDownloadUrl should return value from extension config first
getSqlToolsServiceDownloadUrl should return value from config.json if not exit in extension config
  ✅ ExtConfig Tests getSqlToolsServiceDownloadUrl should return value from config.json if not exit in extension config
getSqlToolsConfigValue should return value from extension config first
  ✅ ExtConfig Tests getSqlToolsConfigValue should return value from extension config first
getSqlToolsConfigValue should return value from config.json if not exit in extension config
  ✅ ExtConfig Tests getSqlToolsConfigValue should return value from config.json if not exit in extension config
getExtensionConfig should return value from extension config
  ✅ ExtConfig Tests getExtensionConfig should return value from extension config
getExtensionConfig should return the default value if the extension does not have the config
  ✅ ExtConfig Tests getExtensionConfig should return the default value if the extension does not have the config
getWorkspaceConfig should return value from workspace config
  ✅ ExtConfig Tests getWorkspaceConfig should return value from workspace config
getWorkspaceConfig should return the default value if the workspace does not have the config
  ✅ ExtConfig Tests getWorkspaceConfig should return the default value if the workspace does not have the config

✅ Firewall Service Tests

Handle Firewall Rule test
  ✅ Firewall Service Tests Handle Firewall Rule test
Create Firewall Rule Test
  ✅ Firewall Service Tests Create Firewall Rule Test

✅ HttpClient Tests

handleDataReceivedEvent test
  ✅ Language Service Tests HttpClient Tests handleDataReceivedEvent test

✅ Initialization Tests

Connection manager is initialized properly
  ✅ Initialization Tests Connection manager is initialized properly

✅ Input Prompt Tests

Test list prompt render simple question
  ✅ Input Prompt Tests Test list prompt render simple question
Test prompt question with default message
  ✅ Input Prompt Tests Test prompt question with default message
Test prompt question with validation error
  ✅ Input Prompt Tests Test prompt question with validation error

✅ List Prompt Tests

Test list prompt render
  ✅ List Prompt Tests Test list prompt render

✅ Localization Tests

Default Localization Test
  ✅ Localization Tests Default Localization Test
EN Localization Test
  ✅ Localization Tests EN Localization Test
ES Localization Test
  ✅ Localization Tests ES Localization Test

✅ MainController Tests

onDidCloseTextDocument should propogate onDidCloseTextDocument to connectionManager
  ✅ MainController Tests onDidCloseTextDocument should propogate onDidCloseTextDocument to connectionManager
onDidCloseTextDocument should call untitledDoc function when an untitled file is saved
  ✅ MainController Tests onDidCloseTextDocument should call untitledDoc function when an untitled file is saved
onDidCloseTextDocument should call renamedDoc function when rename occurs
  ✅ MainController Tests onDidCloseTextDocument should call renamedDoc function when rename occurs
onDidCloseTextDocument should propogate to the connectionManager even if a special event occured before it
  ✅ MainController Tests onDidCloseTextDocument should propogate to the connectionManager even if a special event occured before it
onDidOpenTextDocument should propogate the function to the connectionManager
  ✅ MainController Tests onDidOpenTextDocument should propogate the function to the connectionManager
onDidSaveTextDocument should propogate the function to the connectionManager
  ✅ MainController Tests onDidSaveTextDocument should propogate the function to the connectionManager
TextDocument Events should handle non-initialized connection manager
  ✅ MainController Tests TextDocument Events should handle non-initialized connection manager
onNewQuery should call the new query and new connection
  ✅ MainController Tests onNewQuery should call the new query and new connection
onNewQuery should not call the new connection if new query fails
  ✅ MainController Tests onNewQuery should not call the new connection if new query fails
validateTextDocumentHasFocus returns false if there is no active text document
  ✅ MainController Tests validateTextDocumentHasFocus returns false if there is no active text document
validateTextDocumentHasFocus returns true if there is an active text document
  ✅ MainController Tests validateTextDocumentHasFocus returns true if there is an active text document
onManageProfiles should call the connetion manager to manage profiles
  ✅ MainController Tests onManageProfiles should call the connetion manager to manage profiles

✅ Metadata Service Tests

Test getMetadata function
  ✅ Metadata Service Tests Test getMetadata function

✅ MssqlProtocolHandler Tests

handleUri - with no command and empty query - returns undefined
  ✅ MssqlProtocolHandler Tests handleUri - with no command and empty query - returns undefined
handleUri - with connect command and no query - doesn't parse query and returns undefined
  ✅ MssqlProtocolHandler Tests handleUri - with connect command and no query - doesn't parse query and returns undefined
handleUri - with connect command and connection string - parses connection string and returns connection info object
  ✅ MssqlProtocolHandler Tests handleUri - with connect command and connection string - parses connection string and returns connection info object
handleUri - with connect command and query - parses query and returns connection info object
  ✅ MssqlProtocolHandler Tests handleUri - with connect command and query - parses query and returns connection info object
handleUri - with connect command and query with invalid bool value for trust server cert - trust server cert is false and parses valid params
  ✅ MssqlProtocolHandler Tests handleUri - with connect command and query with invalid bool value for trust server cert - trust server cert is false and parses valid params
handleUri - with connect command and query with invalid numerical value for connect timeout - timeout is undefined and parses valid params
  ✅ MssqlProtocolHandler Tests handleUri - with connect command and query with invalid numerical value for connect timeout - timeout is undefined and parses valid params
handleUri - with connect command and query invalid parameter - invalid param is undefined
  ✅ MssqlProtocolHandler Tests handleUri - with connect command and query invalid parameter - invalid param is undefined

✅ Object Explorer Node Types Test

Test Add Connection Tree Node
  ✅ Object Explorer Node Types Test Test Add Connection Tree Node
Test Account Sign In Tree Node
  ✅ Object Explorer Node Types Test Test Account Sign In Tree Node
Test Connect Tree Node
  ✅ Object Explorer Node Types Test Test Connect Tree Node
Test getters and setters for Tree Node
  ✅ Object Explorer Node Types Test Test getters and setters for Tree Node
Test fromNodeInfo function
  ✅ Object Explorer Node Types Test Test fromNodeInfo function

✅ Object Explorer Provider Tests

Test Refresh Node
  ✅ Object Explorer Provider Tests Test Refresh Node
Test Connection Credentials
  ✅ Object Explorer Provider Tests Test Connection Credentials
Test remove Object Explorer node
  ✅ Object Explorer Provider Tests Test remove Object Explorer node
Test Get Children from Object Explorer Provider
  ✅ Object Explorer Provider Tests Test Get Children from Object Explorer Provider
Test server nodes sorting mechanism
  ✅ Object Explorer Provider Tests Test server nodes sorting mechanism
Test expandNode function
  ✅ Object Explorer Provider Tests Test expandNode function
Test signInNode function
  ✅ Object Explorer Provider Tests Test signInNode function
Test updateNode function
  ✅ Object Explorer Provider Tests Test updateNode function
Test removeConnectionNodes function
  ✅ Object Explorer Provider Tests Test removeConnectionNodes function
Test addDisconnectedNode function
  ✅ Object Explorer Provider Tests Test addDisconnectedNode function
Test currentNode getter
  ✅ Object Explorer Provider Tests Test currentNode getter
Test rootNodeConnections getter
  ✅ Object Explorer Provider Tests Test rootNodeConnections getter

✅ Object Explorer Utils Tests

Test iconPath function
  ✅ Object Explorer Utils Tests Test iconPath function
Test getNodeUri function
  ✅ Object Explorer Utils Tests Test getNodeUri function
Test getNodeUriFromProfile
  ✅ Object Explorer Utils Tests Test getNodeUriFromProfile
Test getDatabaseName
  ✅ Object Explorer Utils Tests Test getDatabaseName
Test isFirewallError
  ✅ Object Explorer Utils Tests Test isFirewallError

✅ Per File Connection Tests

onNewConnection should ask user for different credentials if connection failed because of invalid credentials
  ✅ Per File Connection Tests onNewConnection should ask user for different credentials if connection failed because of invalid credentials
onNewConnection only prompt user for new credentials onces even if the connection fails again
  ✅ Per File Connection Tests onNewConnection only prompt user for new credentials onces even if the connection fails again
Can create two separate connections for two files
  ✅ Per File Connection Tests Can create two separate connections for two files
Can disconnect one file while another file stays connected
  ✅ Per File Connection Tests Can disconnect one file while another file stays connected
Can disconnect and reconnect one file while another file stays connected
  ✅ Per File Connection Tests Can disconnect and reconnect one file while another file stays connected
Can list databases on server used by current connection and switch databases
  ✅ Per File Connection Tests Can list databases on server used by current connection and switch databases
Can disconnect instead of switching databases
  ✅ Per File Connection Tests Can disconnect instead of switching databases
Prompts for new connection before running query if disconnected
  ✅ Per File Connection Tests Prompts for new connection before running query if disconnected
Change connection notification changes database context
  ✅ Per File Connection Tests Change connection notification changes database context
Should use actual database name instead of <default>
  ✅ Per File Connection Tests Should use actual database name instead of <default>
Should save new connections to recently used list
  ✅ Per File Connection Tests Should save new connections to recently used list
Status view shows updating intellisense after connecting and disappears after intellisense is updated
  ✅ Per File Connection Tests Status view shows updating intellisense after connecting and disappears after intellisense is updated

✅ Platform Tests

getCurrentPlatform should return valid value
  ✅ Platform Tests getCurrentPlatform should return valid value
Retrieve correct information for Ubuntu 14.04
  ✅ Platform Tests Retrieve correct information for Ubuntu 14.04
Retrieve correct information for Ubuntu 14.04 with quotes
  ✅ Platform Tests Retrieve correct information for Ubuntu 14.04 with quotes
Retrieve correct information for Fedora 23
  ✅ Platform Tests Retrieve correct information for Fedora 23
Retrieve correct information for Debian 8
  ✅ Platform Tests Retrieve correct information for Debian 8
Retrieve correct information for CentOS 7
  ✅ Platform Tests Retrieve correct information for CentOS 7
Compute correct RID for Windows 64-bit
  ✅ Platform Tests Compute correct RID for Windows 64-bit
Compute correct RID for Windows 86-bit
  ✅ Platform Tests Compute correct RID for Windows 86-bit
Compute correct RID for Windows ARM 64-bit
  ✅ Platform Tests Compute correct RID for Windows ARM 64-bit
Compute no RID for Windows with bad architecture
  ✅ Platform Tests Compute no RID for Windows with bad architecture
Compute correct RID for MacOS Intel
  ✅ Platform Tests Compute correct RID for MacOS Intel
Compute correct RID for MacOS ARM
  ✅ Platform Tests Compute correct RID for MacOS ARM
Compute no RID for OSX with 32-bit architecture
  ✅ Platform Tests Compute no RID for OSX with 32-bit architecture
Compute correct RID for Ubuntu 14.04
  ✅ Platform Tests Compute correct RID for Ubuntu 14.04
Compute correct RID for Fedora 23
  ✅ Platform Tests Compute correct RID for Fedora 23
Compute correct RID for Debian 8
  ✅ Platform Tests Compute correct RID for Debian 8
Compute correct RID for CentOS 7
  ✅ Platform Tests Compute correct RID for CentOS 7
Compute correct RID for KDE neon
  ✅ Platform Tests Compute correct RID for KDE neon
Compute no RID for CentOS 7 with 32-bit architecture
  ✅ Platform Tests Compute no RID for CentOS 7 with 32-bit architecture
Compute default (Ubuntu_16) RID for fake distro with no ID_LIKE
  ✅ Platform Tests Compute default (Ubuntu_16) RID for fake distro with no ID_LIKE

✅ Prompts test

Test string prompt
  ✅ Prompts test Test string prompt
Test input prompt
  ✅ Prompts test Test input prompt
Test password prompt
  ✅ Prompts test Test password prompt
Test list prompt
  ✅ Prompts test Test list prompt
Test confirm prompt
  ✅ Prompts test Test confirm prompt
Test checkbox prompt
  ✅ Prompts test Test checkbox prompt
Test expand prompt
  ✅ Prompts test Test expand prompt
Test bogus prompt
  ✅ Prompts test Test bogus prompt

✅ Query Runner tests

Constructs properly
  ✅ Query Runner tests Constructs properly
Handles Query Request Result Properly
  ✅ Query Runner tests Handles Query Request Result Properly
Handles Query Request Error Properly
  ✅ Query Runner tests Handles Query Request Error Properly
Notification - Batch Start
  ✅ Query Runner tests Notification - Batch Start
Notification - Batch Complete no message
  ✅ Query Runner tests Notification - Batch Complete no message
Notification - Batch Complete with message
  ✅ Query Runner tests Notification - Batch Complete with message
Notification - ResultSet Complete w/no previous results
  ✅ Query Runner tests Notification - ResultSet Complete w/no previous results
Notification - ResultSet complete w/previous results
  ✅ Query Runner tests Notification - ResultSet complete w/previous results
Notification - Message
  ✅ Query Runner tests Notification - Message
Notification - Query complete
  ✅ Query Runner tests Notification - Query complete
Correctly handles subset
  ✅ Query Runner tests Correctly handles subset
Correctly handles error from subset request
  ✅ Query Runner tests Correctly handles error from subset request
Toggle SQLCMD Mode sends request
  ✅ Query Runner tests Toggle SQLCMD Mode sends request

✅ QueryNotificationHandler tests

QueryNotificationHandler handles registerRunner at the beginning of the event flow
  ✅ QueryNotificationHandler tests QueryNotificationHandler handles registerRunner at the beginning of the event flow
QueryNotificationHandler handles registerRunner in the middle of the event flow
  ✅ QueryNotificationHandler tests QueryNotificationHandler handles registerRunner in the middle of the event flow
QueryNotificationHandler handles registerRunner at the end of the event flow
  ✅ QueryNotificationHandler tests QueryNotificationHandler handles registerRunner at the end of the event flow

✅ ReactWebviewController Tests

Should initialize with initial state
  ✅ ReactWebviewController Tests Should initialize with initial state
Should register default request handlers
  ✅ ReactWebviewController Tests Should register default request handlers
should register a new reducer
  ✅ ReactWebviewController Tests should register a new reducer
should handle getState request
  ✅ ReactWebviewController Tests should handle getState request
should handle action request with registered reducer
  ✅ ReactWebviewController Tests should handle action request with registered reducer
Should throw error for 'action' request with unregistered reducer
  ✅ ReactWebviewController Tests Should throw error for 'action' request with unregistered reducer
should handle getTheme request
  ✅ ReactWebviewController Tests should handle getTheme request
Should handle executeCommand request
  ✅ ReactWebviewController Tests Should handle executeCommand request
Should post notification to webview
  ✅ ReactWebviewController Tests Should post notification to webview
Should set state and send notification to webview
  ✅ ReactWebviewController Tests Should set state and send notification to webview
Should update state and send notification to webview
  ✅ ReactWebviewController Tests Should update state and send notification to webview
Should dispose properly
  ✅ ReactWebviewController Tests Should dispose properly
Should not post message if disposed
  ✅ ReactWebviewController Tests Should not post message if disposed
Should setup theming and handle theme change
  ✅ ReactWebviewController Tests Should setup theming and handle theme change
Should generate correct HTML content
  ✅ ReactWebviewController Tests Should generate correct HTML content
should handle 'sendActionEvent' request
  ✅ ReactWebviewController Tests should handle 'sendActionEvent' request
should handle 'sendErrorEvent' request
  ✅ ReactWebviewController Tests should handle 'sendErrorEvent' request

✅ ReactWebviewPanelController

should create a WebviewPanel with correct options upon initialization
  ✅ ReactWebviewPanelController should create a WebviewPanel with correct options upon initialization
should register onDidDispose handler that disposes the controller
  ✅ ReactWebviewPanelController should register onDidDispose handler that disposes the controller
Should register onDidReceiveMessage handler
  ✅ ReactWebviewPanelController Should register onDidReceiveMessage handler
Should reveal the panel to the foreground
  ✅ ReactWebviewPanelController Should reveal the panel to the foreground
Should reveal the panel to the foreground with the specified view column
  ✅ ReactWebviewPanelController Should reveal the panel to the foreground with the specified view column
should show restore prompt when showRestorePromptAfterClose is true
  ✅ ReactWebviewPanelController should show restore prompt when showRestorePromptAfterClose is true
should dispose without showing restore prompt when showRestorePromptAfterClose is false
  ✅ ReactWebviewPanelController should dispose without showing restore prompt when showRestorePromptAfterClose is false
should set showRestorePromptAfterClose correctly via setter
  ✅ ReactWebviewPanelController should set showRestorePromptAfterClose correctly via setter
Should generate correct HTML template
  ✅ ReactWebviewPanelController Should generate correct HTML template

✅ save results tests

check if filepath prompt displays and right value is set
  ✅ save results tests check if filepath prompt displays and right value is set
Save as CSV - test if information message is displayed on success
  ✅ save results tests Save as CSV - test if information message is displayed on success
Save as CSV - test if error message is displayed on failure to save
  ✅ save results tests Save as CSV - test if error message is displayed on failure to save
Save as JSON - test if information message is displayed on success
  ✅ save results tests Save as JSON - test if information message is displayed on success
Save as JSON - test if error message is displayed on failure to save
  ✅ save results tests Save as JSON - test if error message is displayed on failure to save
Save as Excel - test if information message is displayed on success
  ✅ save results tests Save as Excel - test if information message is displayed on success
Save as Excel - test if error message is displayed on failure to save
  ✅ save results tests Save as Excel - test if error message is displayed on failure to save
Save as with selection - test if selected range is passed in parameters
  ✅ save results tests Save as with selection - test if selected range is passed in parameters
Save as with selection - test case when right click on single cell - no selection is set in parameters
  ✅ save results tests Save as with selection - test case when right click on single cell - no selection is set in parameters
canceling out of save file dialog cancels serialization
  ✅ save results tests canceling out of save file dialog cancels serialization

✅ Scripting Service Tests

Test Get Object From Node function
  ✅ Scripting Service Tests Test Get Object From Node function
Test Create Scripting Params
  ✅ Scripting Service Tests Test Create Scripting Params
Test Script Select function
  ✅ Scripting Service Tests Test Script Select function
Test Script Create function
  ✅ Scripting Service Tests Test Script Create function
Test Script Execute function
  ✅ Scripting Service Tests Test Script Execute function
Test Script Drop function
  ✅ Scripting Service Tests Test Script Drop function
Test Script Alter function
  ✅ Scripting Service Tests Test Script Alter function

✅ Server Status View Tests

Test installing service status
  ✅ Server Status View Tests Test installing service status
Test update service download progress status
  ✅ Server Status View Tests Test update service download progress status
Test service installed status
  ✅ Server Status View Tests Test service installed status
Test service installation failed status
  ✅ Server Status View Tests Test service installation failed status

✅ Server tests

findServerPath should return error given a folder with no installed service
  ✅ Server tests findServerPath should return error given a folder with no installed service
findServerPath should return the file path given a file that exists
  ✅ Server tests findServerPath should return the file path given a file that exists
findServerPath should not return the given file path if does not exist
  ✅ Server tests findServerPath should not return the given file path if does not exist
findServerPath should return a valid file path given a folder with installed service
  ✅ Server tests findServerPath should return a valid file path given a folder with installed service
getOrDownloadServer should download the service if not exist and return the valid service file path
  ✅ Server tests getOrDownloadServer should download the service if not exist and return the valid service file path
getOrDownloadServer should not download the service if already exist
  ✅ Server tests getOrDownloadServer should not download the service if already exist

✅ Service Client tests

initializeForPlatform should fail given unsupported platform
  ✅ Service Client tests initializeForPlatform should fail given unsupported platform
handleLanguageServiceStatusNotification should change the UI status
  ✅ Service Client tests handleLanguageServiceStatusNotification should change the UI status

✅ ServiceDownloadProvider Tests

getInstallDirectory should return the exact value from config if the path is absolute
  ✅ ServiceDownloadProvider Tests getInstallDirectory should return the exact value from config if the path is absolute
getInstallDirectory should add the version to the path given the path with the version template key
  ✅ ServiceDownloadProvider Tests getInstallDirectory should add the version to the path given the path with the version template key
getInstallDirectory should add the platform to the path given the path with the platform template key
  ✅ ServiceDownloadProvider Tests getInstallDirectory should add the platform to the path given the path with the platform template key
  ✅ ServiceDownloadProvider Tests getInstallDirectory should add the platform to the path given the path with the platform template key
getDownloadFileName should return the expected file name given a runtime
  ✅ ServiceDownloadProvider Tests getDownloadFileName should return the expected file name given a runtime
installSQLToolsService should download and decompress the service and update the status
  ✅ ServiceDownloadProvider Tests installSQLToolsService should download and decompress the service and update the status

✅ SqlOutputProvider Tests using mocks

Correctly outputs the new result pane view column
  ✅ SqlOutputProvider Tests using mocks Correctly outputs the new result pane view column
RunQuery properly sets up two queries to be run
  ✅ SqlOutputProvider Tests using mocks RunQuery properly sets up two queries to be run
RunQuery only sets up one uri with the same name
  ✅ SqlOutputProvider Tests using mocks RunQuery only sets up one uri with the same name
onUntitledFileSaved should delete the untitled file and create a new titled file
  ✅ SqlOutputProvider Tests using mocks onUntitledFileSaved should delete the untitled file and create a new titled file
onDidCloseTextDocument properly mark the uri for deletion
  ✅ SqlOutputProvider Tests using mocks onDidCloseTextDocument properly mark the uri for deletion
isRunningQuery should return the correct state for the query
  ✅ SqlOutputProvider Tests using mocks isRunningQuery should return the correct state for the query
cancelQuery should cancel the execution of a query by result pane URI
  ✅ SqlOutputProvider Tests using mocks cancelQuery should cancel the execution of a query by result pane URI
cancelQuery should cancel the execution of a query by SQL pane URI
  ✅ SqlOutputProvider Tests using mocks cancelQuery should cancel the execution of a query by SQL pane URI
getQueryRunner should return the appropriate query runner
  ✅ SqlOutputProvider Tests using mocks getQueryRunner should return the appropriate query runner
cancelQuery with no query running should show information message about it
  ✅ SqlOutputProvider Tests using mocks cancelQuery with no query running should show information message about it
getQueryRunner should return undefined for new URI
  ✅ SqlOutputProvider Tests using mocks getQueryRunner should return undefined for new URI
toggleSqlCmd should do nothing if no queryRunner exists
  ✅ SqlOutputProvider Tests using mocks toggleSqlCmd should do nothing if no queryRunner exists
Test queryResultsMap getters and setters
  ✅ SqlOutputProvider Tests using mocks Test queryResultsMap getters and setters
showErrorRequestHandler should call vscodeWrapper to show error message
  ✅ SqlOutputProvider Tests using mocks showErrorRequestHandler should call vscodeWrapper to show error message
showWarningRequestHandler should call vscodeWrapper to show warning message
  ✅ SqlOutputProvider Tests using mocks showWarningRequestHandler should call vscodeWrapper to show warning message
A query runner should only exist if a query is run
  ✅ SqlOutputProvider Tests using mocks A query runner should only exist if a query is run

✅ Status View Tests

updateStatusMessage should not immediately update status message for definition request
  ✅ Status View Tests updateStatusMessage should not immediately update status message for definition request
updateStatusMessage should not update status message for definition request if already completed
  ✅ Status View Tests updateStatusMessage should not update status message for definition request if already completed
updateStatusMessage should update status message for definition request completed
  ✅ Status View Tests updateStatusMessage should update status message for definition request completed
updateStatusMessage should update status message for updating intelliSense
  ✅ Status View Tests updateStatusMessage should update status message for updating intelliSense
updateStatusMessage should update status message for intelliSense updated status
  ✅ Status View Tests updateStatusMessage should update status message for intelliSense updated status

✅ Stub Logger tests

Test logdebug method
  ✅ Stub Logger tests Test logdebug method
Test increaseIndent method
  ✅ Stub Logger tests Test increaseIndent method
Test decreaseIndent method
  ✅ Stub Logger tests Test decreaseIndent method
Test append method
  ✅ Stub Logger tests Test append method
Test appendLine method
  ✅ Stub Logger tests Test appendLine method

✅ Stub Status View tests

Test installing service method
  ✅ Stub Status View tests Test installing service method
Test service installed method
  ✅ Stub Status View tests Test service installed method
Test service installation failed method
  ✅ Stub Status View tests Test service installation failed method
Test update service downloading progress method
  ✅ Stub Status View tests Test update service downloading progress method

✅ Test Checkbox prompt

Test checkbox prompt with simple question
  ✅ Test Checkbox prompt Test checkbox prompt with simple question
Test Checkbox prompt with error
  ✅ Test Checkbox prompt Test Checkbox prompt with error
Test Checkbox prompt with checked answer
  ✅ Test Checkbox prompt Test Checkbox prompt with checked answer

✅ Test Expand Prompt

Test expand prompt with simple question
  ✅ Test Expand Prompt Test expand prompt with simple question

✅ Test Service Installer Util functions

Test getServiceInstallDirectoryRoot function
  ✅ Test Service Installer Util functions Test getServiceInstallDirectoryRoot function
Test installService function
  ✅ Test Service Installer Util functions Test installService function

✅ UserSurvey Tests

should create and return the same UserSurvey instance
  ✅ UserSurvey Tests should create and return the same UserSurvey instance
should not prompt the user if they opted out of the survey
  ✅ UserSurvey Tests should not prompt the user if they opted out of the survey
Should not prompt use if skip version is set
  ✅ UserSurvey Tests Should not prompt use if skip version is set
should prompt for feedback after session count reaches threshold
  ✅ UserSurvey Tests should prompt for feedback after session count reaches threshold
should update global state and send telemetry after survey submission
  ✅ UserSurvey Tests should update global state and send telemetry after survey submission
Should reduce session count when user clicks "Later"
  ✅ UserSurvey Tests Should reduce session count when user clicks "Later"
Should set never key when user clicks 'Never'
  ✅ UserSurvey Tests Should set never key when user clicks 'Never'

✅ Utility tests - getSignInQuickPickItems

first quick pick item should be Azure Sign In
  ✅ Utility tests - getSignInQuickPickItems first quick pick item should be Azure Sign In
second quick pick item should be Azure Sign In With Device Code
  ✅ Utility tests - getSignInQuickPickItems second quick pick item should be Azure Sign In With Device Code
third quick pick item should be Azure Sign In to Azure Cloud
  ✅ Utility tests - getSignInQuickPickItems third quick pick item should be Azure Sign In to Azure Cloud

✅ Utility Tests - isSameConnection

should return true for matching non-connectionstring connections
  ✅ Utility Tests - isSameConnection should return true for matching non-connectionstring connections
should return false for non-matching non-connectionstring connections
  ✅ Utility Tests - isSameConnection should return false for non-matching non-connectionstring connections
should return true for matching connectionstring connections
  ✅ Utility Tests - isSameConnection should return true for matching connectionstring connections
should return false for non-matching connectionstring connections
  ✅ Utility Tests - isSameConnection should return false for non-matching connectionstring connections
should return false for connectionstring and non-connectionstring connections
  ✅ Utility Tests - isSameConnection should return false for connectionstring and non-connectionstring connections

✅ Utility Tests - parseNumAsTimeString

returns the correct value
  ✅ Utility Tests - parseNumAsTimeString returns the correct value

✅ Utility Tests - parseTimeString

should return false if nothing passed
  ✅ Utility Tests - parseTimeString should return false if nothing passed
should return false if input does not have only 1 period
  ✅ Utility Tests - parseTimeString should return false if input does not have only 1 period
should return false if input does not have 2 :
  ✅ Utility Tests - parseTimeString should return false if input does not have 2 :
returns the correct value
  ✅ Utility Tests - parseTimeString returns the correct value

✅ Webview Panel Controller Tests

Initializing a controller should create and open a new webview panel
  ✅ Webview Panel Controller Tests Initializing a controller should create and open a new webview panel
Closing the Webview Panel should dispose the webview
  ✅ Webview Panel Controller Tests Closing the Webview Panel should dispose the webview