Skip to content

Commit e8ab9be

Browse files
Kartik Rajkarthiknadig
Kartik Raj
andauthored
Cherry pick fixes and update package.json (#20127)
- Update engine to upcoming VS Code version. (#20058) - Update `package.json` to remove `-rc`. Co-authored-by: Karthik Nadig <kanadig@microsoft.com>
1 parent 9e263dc commit e8ab9be

File tree

4 files changed

+40
-9
lines changed

4 files changed

+40
-9
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "python",
33
"displayName": "Python",
44
"description": "IntelliSense (Pylance), Linting, Debugging (multi-threaded, remote), Jupyter Notebooks, code formatting, refactoring, unit tests, and more.",
5-
"version": "2022.18.0-rc",
5+
"version": "2022.18.0",
66
"featureFlags": {
77
"usingNewInterpreterStorage": true
88
},
@@ -40,7 +40,7 @@
4040
"theme": "dark"
4141
},
4242
"engines": {
43-
"vscode": "^1.68.0"
43+
"vscode": "^1.73.0-insider"
4444
},
4545
"keywords": [
4646
"python",

src/test/debuggerTest.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,29 @@
22
// Licensed under the MIT License.
33

44
import * as path from 'path';
5+
import * as fs from 'fs-extra';
56
import { runTests } from '@vscode/test-electron';
67
import { EXTENSION_ROOT_DIR_FOR_TESTS } from './constants';
8+
import { EXTENSION_ROOT_DIR } from '../client/common/constants';
79

810
const workspacePath = path.join(__dirname, '..', '..', 'src', 'testMultiRootWkspc', 'multi.code-workspace');
911
process.env.IS_CI_SERVER_TEST_DEBUGGER = '1';
1012
process.env.VSC_PYTHON_CI_TEST = '1';
11-
const channel = process.env.VSC_PYTHON_CI_TEST_VSC_CHANNEL || 'stable';
13+
14+
function getChannel(): string {
15+
if (process.env.VSC_PYTHON_CI_TEST_VSC_CHANNEL) {
16+
return process.env.VSC_PYTHON_CI_TEST_VSC_CHANNEL;
17+
}
18+
19+
const packageJsonPath = path.join(EXTENSION_ROOT_DIR, 'package.json');
20+
if (fs.pathExistsSync(packageJsonPath)) {
21+
const packageJson = fs.readJSONSync(packageJsonPath);
22+
if (packageJson.engines.vscode.endsWith('insider')) {
23+
return 'insiders';
24+
}
25+
}
26+
return 'stable';
27+
}
1228

1329
function start() {
1430
console.log('*'.repeat(100));
@@ -17,7 +33,7 @@ function start() {
1733
extensionDevelopmentPath: EXTENSION_ROOT_DIR_FOR_TESTS,
1834
extensionTestsPath: path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'out', 'test', 'index'),
1935
launchArgs: [workspacePath],
20-
version: channel,
36+
version: getChannel(),
2137
extensionTestsEnv: { ...process.env, UITEST_DISABLE_INSIDERS: '1' },
2238
}).catch((ex) => {
2339
console.error('End Debugger tests (with errors)', ex);

src/test/standardTest.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as fs from 'fs-extra';
33
import * as os from 'os';
44
import * as path from 'path';
55
import { downloadAndUnzipVSCode, resolveCliPathFromVSCodeExecutablePath, runTests } from '@vscode/test-electron';
6-
import { JUPYTER_EXTENSION_ID, PYLANCE_EXTENSION_ID } from '../client/common/constants';
6+
import { EXTENSION_ROOT_DIR, JUPYTER_EXTENSION_ID, PYLANCE_EXTENSION_ID } from '../client/common/constants';
77
import { EXTENSION_ROOT_DIR_FOR_TESTS } from './constants';
88

99
// If running smoke tests, we don't have access to this.
@@ -27,7 +27,20 @@ const extensionDevelopmentPath = process.env.CODE_EXTENSIONS_PATH
2727
? process.env.CODE_EXTENSIONS_PATH
2828
: EXTENSION_ROOT_DIR_FOR_TESTS;
2929

30-
const channel = process.env.VSC_PYTHON_CI_TEST_VSC_CHANNEL || 'stable';
30+
async function getChannel(): Promise<string> {
31+
if (process.env.VSC_PYTHON_CI_TEST_VSC_CHANNEL) {
32+
return process.env.VSC_PYTHON_CI_TEST_VSC_CHANNEL;
33+
}
34+
35+
const packageJsonPath = path.join(EXTENSION_ROOT_DIR, 'package.json');
36+
if (await fs.pathExists(packageJsonPath)) {
37+
const packageJson = await fs.readJSON(packageJsonPath);
38+
if (packageJson.engines.vscode.endsWith('insider')) {
39+
return 'insiders';
40+
}
41+
}
42+
return 'stable';
43+
}
3144

3245
/**
3346
* Smoke tests & tests running in VSCode require Jupyter extension to be installed.
@@ -77,6 +90,8 @@ async function installPylanceExtension(vscodeExecutablePath: string) {
7790
async function start() {
7891
console.log('*'.repeat(100));
7992
console.log('Start Standard tests');
93+
const channel = await getChannel();
94+
console.log(`Using ${channel} build of VS Code.`);
8095
const vscodeExecutablePath = await downloadAndUnzipVSCode(channel);
8196
const baseLaunchArgs =
8297
requiresJupyterExtensionToBeInstalled() || requiresPylanceExtensionToBeInstalled()

0 commit comments

Comments
 (0)