@@ -3,7 +3,7 @@ import * as fs from 'fs-extra';
3
3
import * as os from 'os' ;
4
4
import * as path from 'path' ;
5
5
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' ;
7
7
import { EXTENSION_ROOT_DIR_FOR_TESTS } from './constants' ;
8
8
9
9
// If running smoke tests, we don't have access to this.
@@ -27,7 +27,20 @@ const extensionDevelopmentPath = process.env.CODE_EXTENSIONS_PATH
27
27
? process . env . CODE_EXTENSIONS_PATH
28
28
: EXTENSION_ROOT_DIR_FOR_TESTS ;
29
29
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
+ }
31
44
32
45
/**
33
46
* Smoke tests & tests running in VSCode require Jupyter extension to be installed.
@@ -77,6 +90,8 @@ async function installPylanceExtension(vscodeExecutablePath: string) {
77
90
async function start ( ) {
78
91
console . log ( '*' . repeat ( 100 ) ) ;
79
92
console . log ( 'Start Standard tests' ) ;
93
+ const channel = await getChannel ( ) ;
94
+ console . log ( `Using ${ channel } build of VS Code.` ) ;
80
95
const vscodeExecutablePath = await downloadAndUnzipVSCode ( channel ) ;
81
96
const baseLaunchArgs =
82
97
requiresJupyterExtensionToBeInstalled ( ) || requiresPylanceExtensionToBeInstalled ( )
0 commit comments