Skip to content

Commit c56fb61

Browse files
committed
append to standardTest to update setting
1 parent 4a2a5d0 commit c56fb61

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

src/test/smokeTest.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ class TestRunner {
4747
);
4848
}
4949
private async launchTest(customEnvVars: Record<string, {}>) {
50-
const configurationTerminal = workspace.getConfiguration('terminal');
51-
await configurationTerminal.update('integrated.defaultProfile.osx', 'pwsh', ConfigurationTarget.Global);
52-
await configurationTerminal.update('integrated.defaultProfile.linux', 'pwsh', ConfigurationTarget.Global);
53-
await configurationTerminal.update('integrated.defaultProfile.windows', 'pwsh', ConfigurationTarget.Global);
54-
5550
console.log('Launch tests in test runner');
5651
await new Promise<void>((resolve, reject) => {
5752
const env: Record<string, string> = {

src/test/standardTest.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,29 @@ const extensionDevelopmentPath = process.env.CODE_EXTENSIONS_PATH
2929
? process.env.CODE_EXTENSIONS_PATH
3030
: EXTENSION_ROOT_DIR_FOR_TESTS;
3131

32+
// Make sure shell used are pwsh for smoke tests
33+
// create .vscode folder inside workspacePath and settings.json inside that .vscode path
34+
async function setupWorkspace() {
35+
await fs.ensureDir(path.join(workspacePath, '.vscode'));
36+
const settingsPath = path.join(workspacePath, '.vscode', 'settings.json');
37+
if (!(await fs.pathExists(settingsPath))) {
38+
await fs.writeFile(
39+
settingsPath,
40+
`{
41+
"terminal.integrated.defaultProfile.linux": "pwsh",
42+
"terminal.integrated.defaultProfile.osx": "pwsh",
43+
"terminal.integrated.defaultProfile.windows": "pwsh"
44+
}`,
45+
);
46+
}
47+
}
48+
if (process.env.TEST_FILES_SUFFIX !== 'smoke.test') {
49+
setupWorkspace().catch((err) => {
50+
console.error('Failed to setup workspace for smoke test', err);
51+
process.exit(1);
52+
});
53+
}
54+
3255
/**
3356
* Smoke tests & tests running in VSCode require Jupyter extension to be installed.
3457
*/

0 commit comments

Comments
 (0)