Skip to content

Commit c2d1b13

Browse files
author
Paul Wang
authored
Fix tests (#90)
1 parent 5b61b50 commit c2d1b13

3 files changed

Lines changed: 38 additions & 3 deletions

File tree

src/vs/workbench/services/environment/browser/environmentService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ export class BrowserWorkbenchEnvironmentService implements IBrowserWorkbenchEnvi
306306
extensionDevelopmentKind: undefined
307307
};
308308

309-
// Extension host development options from the payload are only valid in development builds.
310-
if (this.payload && !this.isBuilt) {
309+
// Extension host development options from the payload are only valid in development or smoke test builds.
310+
if (this.payload && (!this.isBuilt || this.enableSmokeTestDriver)) {
311311
for (const [key, value] of this.payload) {
312312
switch (key) {
313313
case 'extensionDevelopmentPath':

src/vs/workbench/services/environment/test/browser/environmentService.test.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,39 @@ suite('BrowserWorkbenchEnvironmentService', () => {
100100
extensionEnabledProposedApi: []
101101
});
102102
});
103+
104+
test('accepts extension host options from payload in production smoke tests', () => {
105+
const environmentService = new BrowserWorkbenchEnvironmentService('', URI.file('/logs'), {
106+
developmentOptions: { enableSmokeTestDriver: true, logLevel: LogLevel.Info },
107+
workspaceProvider: {
108+
workspace: undefined,
109+
trusted: true,
110+
payload: privilegedPayload,
111+
open: async () => true
112+
}
113+
}, { ...TestProductService, commit: 'built' });
114+
115+
assert.deepStrictEqual({
116+
debugExtensionHost: environmentService.debugExtensionHost,
117+
debugRenderer: environmentService.debugRenderer,
118+
isExtensionDevelopment: environmentService.isExtensionDevelopment,
119+
extensionDevelopmentLocationURI: environmentService.extensionDevelopmentLocationURI,
120+
extensionDevelopmentLocationKind: environmentService.extensionDevelopmentLocationKind,
121+
extensionTestsLocationURI: environmentService.extensionTestsLocationURI,
122+
extensionEnabledProposedApi: environmentService.extensionEnabledProposedApi
123+
}, {
124+
debugExtensionHost: {
125+
port: 1234,
126+
break: true,
127+
debugId: 'debug-id',
128+
env: { NODE_OPTIONS: '--import=data:text/javascript,' }
129+
},
130+
debugRenderer: true,
131+
isExtensionDevelopment: true,
132+
extensionDevelopmentLocationURI: [URI.parse('file:///extension')],
133+
extensionDevelopmentLocationKind: ['workspace'],
134+
extensionTestsLocationURI: URI.parse('file:///extension/test.js'),
135+
extensionEnabledProposedApi: []
136+
});
137+
});
103138
});

test/integration/browser/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ async function launchServer(browserType: BrowserType, browserChannel: BrowserCha
191191
...process.env
192192
};
193193

194-
const serverArgs = ['--enable-proposed-api', '--disable-telemetry', '--disable-experiments', '--server-data-dir', userDataDir, '--accept-server-license-terms', '--disable-workspace-trust'];
194+
const serverArgs = ['--enable-proposed-api', '--disable-telemetry', '--disable-experiments', '--server-data-dir', userDataDir, '--accept-server-license-terms', '--disable-workspace-trust', '--enable-smoke-test-driver'];
195195

196196
let serverLocation: string;
197197
if (process.env.VSCODE_REMOTE_SERVER_PATH) {

0 commit comments

Comments
 (0)