@@ -37,8 +37,8 @@ import { setup as setupDataMultirootTests } from './areas/multiroot/multiroot.te
37
37
import { setup as setupDataLocalizationTests } from './areas/workbench/localization.test' ;
38
38
import { setup as setupLaunchTests } from './areas/workbench/launch.test' ;
39
39
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 ) ;
42
42
process . exit ( 1 ) ;
43
43
}
44
44
@@ -73,7 +73,6 @@ const extensionsPath = path.join(testDataPath, 'extensions-dir');
73
73
mkdirp . sync ( extensionsPath ) ;
74
74
75
75
const screenshotsPath = opts . screenshots ? path . resolve ( opts . screenshots ) : null ;
76
-
77
76
if ( screenshotsPath ) {
78
77
mkdirp . sync ( screenshotsPath ) ;
79
78
}
@@ -83,10 +82,6 @@ function fail(errorMessage): void {
83
82
process . exit ( 1 ) ;
84
83
}
85
84
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
-
90
85
const repoPath = path . join ( __dirname , '..' , '..' , '..' ) ;
91
86
92
87
function getDevElectronPath ( ) : string {
@@ -122,44 +117,65 @@ function getBuildElectronPath(root: string): string {
122
117
}
123
118
}
124
119
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
+ }
129
145
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
+ }
132
149
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 ;
135
156
}
136
157
} 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 ;
143
159
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
+ }
147
169
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
+ }
150
175
}
151
176
152
177
const userDataDir = path . join ( testDataPath , 'd' ) ;
153
178
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
-
163
179
async function setupRepository ( ) : Promise < void > {
164
180
if ( opts [ 'test-repo' ] ) {
165
181
console . log ( '*** Copying test project repository:' , opts [ 'test-repo' ] ) ;
@@ -246,7 +262,7 @@ after(async function () {
246
262
} ) ;
247
263
248
264
if ( ! opts . web ) {
249
- setupDataMigrationTests ( stableCodePath , testDataPath ) ;
265
+ setupDataMigrationTests ( opts [ 'stable-build' ] , testDataPath ) ;
250
266
}
251
267
252
268
describe ( 'Running Code' , ( ) => {
0 commit comments