@@ -37,8 +37,8 @@ import { setup as setupDataMultirootTests } from './areas/multiroot/multiroot.te
3737import { setup as setupDataLocalizationTests } from './areas/workbench/localization.test' ;
3838import { setup as setupLaunchTests } from './areas/workbench/launch.test' ;
3939
40- if ( ! / ^ v 1 0 / . test ( process . version ) ) {
41- console . error ( 'Error: Smoketest must be run using Node 10. Currently running' , process . version ) ;
40+ if ( ! / ^ v 1 0 / . test ( process . version ) && ! / ^ v 1 2 / . test ( process . version ) ) {
41+ console . error ( 'Error: Smoketest must be run using Node 10/12 . Currently running' , process . version ) ;
4242 process . exit ( 1 ) ;
4343}
4444
@@ -73,7 +73,6 @@ const extensionsPath = path.join(testDataPath, 'extensions-dir');
7373mkdirp . sync ( extensionsPath ) ;
7474
7575const screenshotsPath = opts . screenshots ? path . resolve ( opts . screenshots ) : null ;
76-
7776if ( screenshotsPath ) {
7877 mkdirp . sync ( screenshotsPath ) ;
7978}
@@ -83,10 +82,6 @@ function fail(errorMessage): void {
8382 process . exit ( 1 ) ;
8483}
8584
86- if ( parseInt ( process . version . substr ( 1 ) ) < 6 ) {
87- fail ( 'Please update your Node version to greater than 6 to run the smoke test.' ) ;
88- }
89-
9085const repoPath = path . join ( __dirname , '..' , '..' , '..' ) ;
9186
9287function getDevElectronPath ( ) : string {
@@ -122,44 +117,65 @@ function getBuildElectronPath(root: string): string {
122117 }
123118}
124119
125- let testCodePath = opts . build ;
126- let stableCodePath = opts [ 'stable-build' ] ;
127- let electronPath : string ;
128- let stablePath : string | undefined = undefined ;
120+ let quality : Quality ;
121+
122+ if ( ! opts . web ) {
123+ let testCodePath = opts . build ;
124+ let stableCodePath = opts [ 'stable-build' ] ;
125+ let electronPath : string ;
126+ let stablePath : string | undefined = undefined ;
127+
128+ if ( testCodePath ) {
129+ electronPath = getBuildElectronPath ( testCodePath ) ;
130+
131+ if ( stableCodePath ) {
132+ stablePath = getBuildElectronPath ( stableCodePath ) ;
133+ }
134+ } else {
135+ testCodePath = getDevElectronPath ( ) ;
136+ electronPath = testCodePath ;
137+ process . env . VSCODE_REPOSITORY = repoPath ;
138+ process . env . VSCODE_DEV = '1' ;
139+ process . env . VSCODE_CLI = '1' ;
140+ }
141+
142+ if ( ! fs . existsSync ( electronPath || '' ) ) {
143+ fail ( `Can't find VSCode at ${ electronPath } .` ) ;
144+ }
129145
130- if ( testCodePath ) {
131- electronPath = getBuildElectronPath ( testCodePath ) ;
146+ if ( typeof stablePath === 'string' && ! fs . existsSync ( stablePath ) ) {
147+ fail ( `Can't find Stable VSCode at ${ stablePath } .` ) ;
148+ }
132149
133- if ( stableCodePath ) {
134- stablePath = getBuildElectronPath ( stableCodePath ) ;
150+ if ( process . env . VSCODE_DEV === '1' ) {
151+ quality = Quality . Dev ;
152+ } else if ( electronPath . indexOf ( 'Code - Insiders' ) >= 0 /* macOS/Windows */ || electronPath . indexOf ( 'code-insiders' ) /* Linux */ >= 0 ) {
153+ quality = Quality . Insiders ;
154+ } else {
155+ quality = Quality . Stable ;
135156 }
136157} else {
137- testCodePath = getDevElectronPath ( ) ;
138- electronPath = testCodePath ;
139- process . env . VSCODE_REPOSITORY = repoPath ;
140- process . env . VSCODE_DEV = '1' ;
141- process . env . VSCODE_CLI = '1' ;
142- }
158+ let testCodeServerPath = process . env . VSCODE_REMOTE_SERVER_PATH ;
143159
144- if ( ! opts . web && ! fs . existsSync ( electronPath || '' ) ) {
145- fail ( `Can't find Code at ${ electronPath } .` ) ;
146- }
160+ if ( typeof testCodeServerPath === 'string' && ! fs . existsSync ( testCodeServerPath ) ) {
161+ fail ( `Can't find Code server at ${ testCodeServerPath } .` ) ;
162+ }
163+
164+ if ( ! testCodeServerPath ) {
165+ process . env . VSCODE_REPOSITORY = repoPath ;
166+ process . env . VSCODE_DEV = '1' ;
167+ process . env . VSCODE_CLI = '1' ;
168+ }
147169
148- if ( typeof stablePath === 'string' && ! fs . existsSync ( stablePath ) ) {
149- fail ( `Can't find Stable Code at ${ stablePath } .` ) ;
170+ if ( process . env . VSCODE_DEV === '1' ) {
171+ quality = Quality . Dev ;
172+ } else {
173+ quality = Quality . Insiders ;
174+ }
150175}
151176
152177const userDataDir = path . join ( testDataPath , 'd' ) ;
153178
154- let quality : Quality ;
155- if ( process . env . VSCODE_DEV === '1' ) {
156- quality = Quality . Dev ;
157- } else if ( electronPath . indexOf ( 'Code - Insiders' ) >= 0 /* macOS/Windows */ || electronPath . indexOf ( 'code-insiders' ) /* Linux */ >= 0 ) {
158- quality = Quality . Insiders ;
159- } else {
160- quality = Quality . Stable ;
161- }
162-
163179async function setupRepository ( ) : Promise < void > {
164180 if ( opts [ 'test-repo' ] ) {
165181 console . log ( '*** Copying test project repository:' , opts [ 'test-repo' ] ) ;
@@ -246,7 +262,7 @@ after(async function () {
246262} ) ;
247263
248264if ( ! opts . web ) {
249- setupDataMigrationTests ( stableCodePath , testDataPath ) ;
265+ setupDataMigrationTests ( opts [ 'stable-build' ] , testDataPath ) ;
250266}
251267
252268describe ( 'Running Code' , ( ) => {
0 commit comments