Skip to content

Commit 9b93e95

Browse files
committed
add install for envs ext
1 parent ca29988 commit 9b93e95

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

src/test/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ function isMultiRootTest() {
3333
export const EXTENSION_ROOT_DIR_FOR_TESTS = path.join(__dirname, '..', '..');
3434
export const PVSC_EXTENSION_ID_FOR_TESTS = 'ms-python.python';
3535

36+
export const PVSC_ENVS_EXTENSION_ID_FOR_TESTS = 'ms-python.vscode-python-envs';
37+
3638
export const SMOKE_TEST_EXTENSIONS_DIR = path.join(
3739
EXTENSION_ROOT_DIR_FOR_TESTS,
3840
'tmp',

src/test/runTest.ts

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as cp from 'child_process';
22
import * as path from 'path';
33

44
import { downloadAndUnzipVSCode, resolveCliArgsFromVSCodeExecutablePath, runTests } from '@vscode/test-electron';
5-
import { PVSC_EXTENSION_ID_FOR_TESTS } from './constants';
5+
import { PVSC_ENVS_EXTENSION_ID_FOR_TESTS, PVSC_EXTENSION_ID_FOR_TESTS } from './constants';
66
import { OSType, getOSType } from '../extension/common/platform';
77

88
async function main() {
@@ -20,16 +20,24 @@ async function main() {
2020
// Use cp.spawn / cp.exec for custom setup
2121
if (getOSType() === OSType.Windows) {
2222
const exec = path.basename(cliPath);
23-
cp.spawnSync(exec, [...args, '--install-extension', PVSC_EXTENSION_ID_FOR_TESTS], {
24-
cwd: path.dirname(cliPath),
25-
encoding: 'utf-8',
26-
stdio: 'inherit',
27-
});
23+
cp.spawnSync(
24+
exec,
25+
[...args, '--install-extension', PVSC_EXTENSION_ID_FOR_TESTS, PVSC_ENVS_EXTENSION_ID_FOR_TESTS],
26+
{
27+
cwd: path.dirname(cliPath),
28+
encoding: 'utf-8',
29+
stdio: 'inherit',
30+
},
31+
);
2832
} else {
29-
cp.spawnSync(cliPath, [...args, '--install-extension', PVSC_EXTENSION_ID_FOR_TESTS], {
30-
encoding: 'utf-8',
31-
stdio: 'inherit',
32-
});
33+
cp.spawnSync(
34+
cliPath,
35+
[...args, '--install-extension', PVSC_EXTENSION_ID_FOR_TESTS, PVSC_ENVS_EXTENSION_ID_FOR_TESTS],
36+
{
37+
encoding: 'utf-8',
38+
stdio: 'inherit',
39+
},
40+
);
3341
}
3442

3543
// Run the extension test

0 commit comments

Comments
 (0)