@@ -18,7 +18,7 @@ const minimum = 'minimum'
18
18
19
19
const disableWorkspaceTrust = '--disable-workspace-trust'
20
20
21
- type SuiteName = 'integration' | 'e2e' | 'unit'
21
+ type SuiteName = 'integration' | 'e2e' | 'unit' | 'web'
22
22
23
23
/**
24
24
* This is the generalized method that is used by different test suites (unit, integration, ...) in CI to
@@ -64,7 +64,7 @@ async function getVSCodeCliArgs(params: {
64
64
let disableExtensionsArgs : string [ ] = [ ]
65
65
let disableWorkspaceTrustArg : string [ ] = [ ]
66
66
67
- if ( params . suite !== 'unit ') {
67
+ if ( params . suite === 'integration' || params . suite === 'e2e ') {
68
68
disableExtensionsArgs = await getCliArgsToDisableExtensions ( params . vsCodeExecutablePath , {
69
69
except : [
70
70
VSCODE_EXTENSION_ID . python ,
@@ -78,16 +78,21 @@ async function getVSCodeCliArgs(params: {
78
78
] ,
79
79
} )
80
80
disableWorkspaceTrustArg = [ disableWorkspaceTrust ]
81
+ } else {
82
+ disableExtensionsArgs = [ '--disable-extensions' ]
81
83
}
82
84
83
85
const workspacePath = join ( projectRootDir , 'dist' , 'src' , 'testFixtures' , 'workspaceFolder' )
86
+ // This tells VS Code to run the extension in a web environment, which mimics vscode.dev
87
+ const webExtensionKind = params . suite === 'web' ? [ '--extensionDevelopmentKind=web' ] : [ ]
84
88
85
89
return {
86
90
vscodeExecutablePath : params . vsCodeExecutablePath ,
87
91
extensionDevelopmentPath : projectRootDir ,
92
+
88
93
extensionTestsPath : resolve ( projectRootDir , params . relativeTestEntryPoint ) ,
89
94
// For verbose VSCode logs, add "--verbose --log debug". c2165cf48e62c
90
- launchArgs : [ ...disableExtensionsArgs , workspacePath , ...disableWorkspaceTrustArg ] ,
95
+ launchArgs : [ ...disableExtensionsArgs , workspacePath , ...disableWorkspaceTrustArg , ... webExtensionKind ] ,
91
96
extensionTestsEnv : {
92
97
[ 'DEVELOPMENT_PATH' ] : projectRootDir ,
93
98
[ 'AWS_TOOLKIT_AUTOMATION' ] : params . suite ,
@@ -122,7 +127,7 @@ async function setupVSCodeTestInstance(suite: SuiteName): Promise<string> {
122
127
console . log ( await invokeVSCodeCli ( vsCodeExecutablePath , [ '--version' ] ) )
123
128
124
129
// Only certain test suites require specific vscode extensions to be installed
125
- if ( suite !== 'unit ') {
130
+ if ( suite === 'e2e' || suite === 'integration ') {
126
131
await installVSCodeExtension ( vsCodeExecutablePath , VSCODE_EXTENSION_ID . python )
127
132
await installVSCodeExtension ( vsCodeExecutablePath , VSCODE_EXTENSION_ID . yaml )
128
133
await installVSCodeExtension ( vsCodeExecutablePath , VSCODE_EXTENSION_ID . go )
0 commit comments