Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on:
permissions: {}

env:
NODE_VERSION: 18.17.1
NODE_VERSION: 22.17.0
TEST_RESULTS_DIRECTORY: .
# Force a path with spaces and unicode chars to test extension works in these scenarios
special-working-directory: './🐍 🐛'
special-working-directory-relative: '🐍 🐛'
special-working-directory: './testDir'
special-working-directory-relative: 'testDir'

jobs:
build-vsix:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/push-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ on:
permissions: {}

env:
NODE_VERSION: 18.17.1
NODE_VERSION: 22.17.0
TEST_RESULTS_DIRECTORY: .
# Force a path with spaces and unicode chars to test extension works in these scenarios
special-working-directory: './🐍 🐛'
special-working-directory-relative: '🐍 🐛'
special-working-directory: './testDir'
special-working-directory-relative: 'testDir'

jobs:
build-vsix:
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipeline.pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ extends:
buildSteps:
- task: NodeTool@0
inputs:
versionSpec: '18.17.1'
versionSpec: '22.17.0'
displayName: Select Node version

- task: UsePythonVersion@0
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipeline.stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ extends:
buildSteps:
- task: NodeTool@0
inputs:
versionSpec: '18.17.1'
versionSpec: '22.17.0'
displayName: Select Node version

- task: UsePythonVersion@0
Expand Down
291 changes: 166 additions & 125 deletions package-lock.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -612,14 +612,14 @@
"vsce-package": "npx @vscode/vsce package -o python-debugger.vsix"
},
"devDependencies": {
"@types/chai": "^4.3.4",
"@types/chai-as-promised": "^7.1.8",
"@types/chai": "^4.1.2",
"@types/chai-as-promised": "^7.1.0",
"@types/fs-extra": "^11.0.4",
"@types/glob": "^7.2.0",
"@types/lodash": "^4.14.191",
"@types/mocha": "^10.0.7",
"@types/node": "18.x",
"@types/semver": "^7.3.13",
"@types/lodash": "^4.14.104",
"@types/mocha": "^9.1.0",
"@types/node": "^22.5.0",
"@types/semver": "^5.5.0",
"@types/sinon": "^10.0.13",
"@types/vscode": "^1.87.0",
"@typescript-eslint/eslint-plugin": "^5.62.0",
Expand All @@ -638,17 +638,17 @@
"ts-mockito": "^2.6.1",
"typemoq": "^2.1.0",
"typescript": "^5.5.4",
"webpack": "^5.87.0",
"webpack-cli": "^5.1.4"
"webpack": "^5.76.0",
"webpack-cli": "^4.9.2"
},
"dependencies": {
"@vscode/debugadapter": "^1.65.0",
"@vscode/debugprotocol": "^1.65.0",
"@vscode/extension-telemetry": "^0.8.5",
"@vscode/python-extension": "^1.0.5",
"@vscode/extension-telemetry": "^0.8.4",
"@vscode/python-extension": "^1.0.6",
"fs-extra": "^11.2.0",
"iconv-lite": "^0.6.3",
"jsonc-parser": "^3.2.0",
"jsonc-parser": "^3.0.0",
"lodash": "^4.17.21",
"vscode-languageclient": "^8.0.2"
}
Expand Down
1 change: 0 additions & 1 deletion src/extension/common/python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ async function activateExtension() {
console.log('Python extension activated.');
return extension;
}

async function activateEnvsExtension() {
const extension = extensions.getExtension('ms-python.vscode-python-envs');
if (extension) {
Expand Down
2 changes: 2 additions & 0 deletions src/test/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ function isMultiRootTest() {
export const EXTENSION_ROOT_DIR_FOR_TESTS = path.join(__dirname, '..', '..');
export const PVSC_EXTENSION_ID_FOR_TESTS = 'ms-python.python';

export const PVSC_ENVS_EXTENSION_ID_FOR_TESTS = 'ms-python.vscode-python-envs';

export const SMOKE_TEST_EXTENSIONS_DIR = path.join(
EXTENSION_ROOT_DIR_FOR_TESTS,
'tmp',
Expand Down
55 changes: 42 additions & 13 deletions src/test/runTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import * as cp from 'child_process';
import * as path from 'path';

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

async function main() {
try {
Expand All @@ -18,19 +17,49 @@ async function main() {
const [cliPath, ...args] = resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath);

// Use cp.spawn / cp.exec for custom setup
if (getOSType() === OSType.Windows) {
const exec = path.basename(cliPath);
cp.spawnSync(exec, [...args, '--install-extension', PVSC_EXTENSION_ID_FOR_TESTS], {
cwd: path.dirname(cliPath),
encoding: 'utf-8',
stdio: 'inherit',
});
const isWin = process.platform === 'win32';
if (isWin) {
try {
const installResult = cp.spawnSync(
cliPath,
[...args, '--install-extension', PVSC_EXTENSION_ID_FOR_TESTS, PVSC_ENVS_EXTENSION_ID_FOR_TESTS],
{
cwd: path.dirname(cliPath),
encoding: 'utf8',
stdio: 'inherit',
shell: true,
},
);
if (installResult.error) {
console.error('Extension installation error:', installResult.error);
}
if (installResult.status !== 0) {
console.error(`Extension installation failed with exit code: ${installResult.status}`);
} else {
console.log('Extension installation succeeded.');
}
} catch (ex) {
console.error('Exception during extension installation:', ex);
}
} else {
cp.spawnSync(cliPath, [...args, '--install-extension', PVSC_EXTENSION_ID_FOR_TESTS], {
encoding: 'utf-8',
stdio: 'inherit',
});
const installResult = cp.spawnSync(
cliPath,
[...args, '--install-extension', PVSC_EXTENSION_ID_FOR_TESTS, PVSC_ENVS_EXTENSION_ID_FOR_TESTS],
{
encoding: 'utf8',
stdio: 'inherit',
},
);
if (installResult.error) {
console.error('Extension installation error:', installResult.error);
}
if (installResult.status !== 0) {
console.error(`Extension installation failed with exit code: ${installResult.status}`);
} else {
console.log('Extension installation succeeded.');
}
}
console.log('Extensions installed, ready to run tests.');

// Run the extension test
await runTests({
Expand Down
Loading