Skip to content

Commit 678f70d

Browse files
Remove hack to check the vscode version (#21180)
Closed: #20769
1 parent 6bdada0 commit 678f70d

File tree

6 files changed

+10
-18
lines changed

6 files changed

+10
-18
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"theme": "dark"
4646
},
4747
"engines": {
48-
"vscode": "^1.78.0-20230421"
48+
"vscode": "^1.78.0"
4949
},
5050
"keywords": [
5151
"python",

src/test/debuggerTest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import * as path from 'path';
55
import { runTests } from '@vscode/test-electron';
66
import { EXTENSION_ROOT_DIR_FOR_TESTS } from './constants';
7-
import { getChannel } from './utils/vscode';
7+
import { getVersion } from './utils/vscode';
88

99
const workspacePath = path.join(__dirname, '..', '..', 'src', 'testMultiRootWkspc', 'multi.code-workspace');
1010
process.env.IS_CI_SERVER_TEST_DEBUGGER = '1';
@@ -17,7 +17,7 @@ function start() {
1717
extensionDevelopmentPath: EXTENSION_ROOT_DIR_FOR_TESTS,
1818
extensionTestsPath: path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'out', 'test', 'index'),
1919
launchArgs: [workspacePath],
20-
version: getChannel(),
20+
version: getVersion(),
2121
extensionTestsEnv: { ...process.env, UITEST_DISABLE_INSIDERS: '1' },
2222
}).catch((ex) => {
2323
console.error('End Debugger tests (with errors)', ex);

src/test/multiRootTest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as path from 'path';
22
import { runTests } from '@vscode/test-electron';
33
import { EXTENSION_ROOT_DIR_FOR_TESTS } from './constants';
44
import { initializeLogger } from './testLogger';
5-
import { getChannel } from './utils/vscode';
5+
import { getVersion } from './utils/vscode';
66

77
const workspacePath = path.join(__dirname, '..', '..', 'src', 'testMultiRootWkspc', 'multi.code-workspace');
88
process.env.IS_CI_SERVER_TEST_DEBUGGER = '';
@@ -17,7 +17,7 @@ function start() {
1717
extensionDevelopmentPath: EXTENSION_ROOT_DIR_FOR_TESTS,
1818
extensionTestsPath: path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'out', 'test', 'index'),
1919
launchArgs: [workspacePath],
20-
version: getChannel(),
20+
version: getVersion(),
2121
extensionTestsEnv: { ...process.env, UITEST_DISABLE_INSIDERS: '1' },
2222
}).catch((ex) => {
2323
console.error('End Multiroot tests (with errors)', ex);

src/test/standardTest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as path from 'path';
55
import { downloadAndUnzipVSCode, resolveCliPathFromVSCodeExecutablePath, runTests } from '@vscode/test-electron';
66
import { JUPYTER_EXTENSION_ID, PYLANCE_EXTENSION_ID } from '../client/common/constants';
77
import { EXTENSION_ROOT_DIR_FOR_TESTS } from './constants';
8-
import { getChannel } from './utils/vscode';
8+
import { getVersion } from './utils/vscode';
99

1010
// If running smoke tests, we don't have access to this.
1111
if (process.env.TEST_FILES_SUFFIX !== 'smoke.test') {
@@ -76,7 +76,7 @@ async function installPylanceExtension(vscodeExecutablePath: string) {
7676
async function start() {
7777
console.log('*'.repeat(100));
7878
console.log('Start Standard tests');
79-
const channel = getChannel();
79+
const channel = getVersion();
8080
console.log(`Using ${channel} build of VS Code.`);
8181
const vscodeExecutablePath = await downloadAndUnzipVSCode(channel);
8282
const baseLaunchArgs =

src/test/utils/vscode.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,14 @@ import * as path from 'path';
22
import * as fs from 'fs-extra';
33
import { EXTENSION_ROOT_DIR } from '../../client/common/constants';
44

5-
const insidersVersion = /^\^(\d+\.\d+\.\d+)-(insider|\d{8})$/;
6-
7-
export function getChannel(): string {
5+
export function getVersion(): string {
86
if (process.env.VSC_PYTHON_CI_TEST_VSC_CHANNEL) {
97
return process.env.VSC_PYTHON_CI_TEST_VSC_CHANNEL;
108
}
119
const packageJsonPath = path.join(EXTENSION_ROOT_DIR, 'package.json');
1210
if (fs.pathExistsSync(packageJsonPath)) {
1311
const packageJson = fs.readJSONSync(packageJsonPath);
14-
const engineVersion = packageJson.engines.vscode;
15-
if (insidersVersion.test(engineVersion)) {
16-
// Can't pass in the version number for an insiders build;
17-
// https://github.com/microsoft/vscode-test/issues/176
18-
return 'insiders';
19-
}
20-
return engineVersion.replace('^', '');
12+
return packageJson.engines.vscode.replace('^', '');
2113
}
2214
return 'stable';
2315
}

0 commit comments

Comments
 (0)