Skip to content

Commit 133a8e8

Browse files
Fix CI tests (#20273)
Fix Ci test using the insiders version of vscode in tests. Remove old insider tests.
1 parent a2aa1fb commit 133a8e8

File tree

7 files changed

+23
-319
lines changed

7 files changed

+23
-319
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
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
@@ -41,7 +41,7 @@
4141
"theme": "dark"
4242
},
4343
"engines": {
44-
"vscode": "^1.74.0"
44+
"vscode": "^1.74.0-insider"
4545
},
4646
"keywords": [
4747
"python",

src/test/debuggerTest.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ function getChannel(): string {
1515
if (process.env.VSC_PYTHON_CI_TEST_VSC_CHANNEL) {
1616
return process.env.VSC_PYTHON_CI_TEST_VSC_CHANNEL;
1717
}
18-
1918
const packageJsonPath = path.join(EXTENSION_ROOT_DIR, 'package.json');
2019
if (fs.pathExistsSync(packageJsonPath)) {
2120
const packageJson = fs.readJSONSync(packageJsonPath);

src/test/insiders/languageServer.insiders.test.ts

Lines changed: 0 additions & 160 deletions
This file was deleted.

src/test/multiRootTest.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,29 @@
11
import * as path from 'path';
2+
import * as fs from 'fs-extra';
23
import { runTests } from '@vscode/test-electron';
34
import { EXTENSION_ROOT_DIR_FOR_TESTS } from './constants';
45
import { initializeLogger } from './testLogger';
6+
import { EXTENSION_ROOT_DIR } from '../client/common/constants';
57

68
const workspacePath = path.join(__dirname, '..', '..', 'src', 'testMultiRootWkspc', 'multi.code-workspace');
79
process.env.IS_CI_SERVER_TEST_DEBUGGER = '';
810
process.env.VSC_PYTHON_CI_TEST = '1';
911

1012
initializeLogger();
1113

12-
const channel = process.env.VSC_PYTHON_CI_TEST_VSC_CHANNEL || 'stable';
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+
const packageJsonPath = path.join(EXTENSION_ROOT_DIR, 'package.json');
19+
if (fs.pathExistsSync(packageJsonPath)) {
20+
const packageJson = fs.readJSONSync(packageJsonPath);
21+
if (packageJson.engines.vscode.endsWith('insider')) {
22+
return 'insiders';
23+
}
24+
}
25+
return 'stable';
26+
}
1327

1428
function start() {
1529
console.log('*'.repeat(100));
@@ -18,7 +32,7 @@ function start() {
1832
extensionDevelopmentPath: EXTENSION_ROOT_DIR_FOR_TESTS,
1933
extensionTestsPath: path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'out', 'test', 'index'),
2034
launchArgs: [workspacePath],
21-
version: channel,
35+
version: getChannel(),
2236
extensionTestsEnv: { ...process.env, UITEST_DISABLE_INSIDERS: '1' },
2337
}).catch((ex) => {
2438
console.error('End Multiroot tests (with errors)', ex);

src/test/standardTest.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,13 @@ const extensionDevelopmentPath = process.env.CODE_EXTENSIONS_PATH
2727
? process.env.CODE_EXTENSIONS_PATH
2828
: EXTENSION_ROOT_DIR_FOR_TESTS;
2929

30-
async function getChannel(): Promise<string> {
30+
function getChannel(): string {
3131
if (process.env.VSC_PYTHON_CI_TEST_VSC_CHANNEL) {
3232
return process.env.VSC_PYTHON_CI_TEST_VSC_CHANNEL;
3333
}
34-
3534
const packageJsonPath = path.join(EXTENSION_ROOT_DIR, 'package.json');
36-
if (await fs.pathExists(packageJsonPath)) {
37-
const packageJson = await fs.readJSON(packageJsonPath);
35+
if (fs.pathExistsSync(packageJsonPath)) {
36+
const packageJson = fs.readJSONSync(packageJsonPath);
3837
if (packageJson.engines.vscode.endsWith('insider')) {
3938
return 'insiders';
4039
}
@@ -90,7 +89,7 @@ async function installPylanceExtension(vscodeExecutablePath: string) {
9089
async function start() {
9190
console.log('*'.repeat(100));
9291
console.log('Start Standard tests');
93-
const channel = await getChannel();
92+
const channel = getChannel();
9493
console.log(`Using ${channel} build of VS Code.`);
9594
const vscodeExecutablePath = await downloadAndUnzipVSCode(channel);
9695
const baseLaunchArgs =

0 commit comments

Comments
 (0)