@@ -194,24 +194,20 @@ async function run() {
194
194
} ) ;
195
195
196
196
try {
197
- const server = startAutoUpdateServer ( {
198
- allowDowngrades : true ,
199
- port : 8080 ,
200
- } ) ;
201
- try {
202
- runTest ( {
197
+ if ( context . platform === 'darwin' && process . env . CI ) {
198
+ // Auto-update does not work on mac in CI at the moment. So in that case
199
+ // we just run the E2E tests to make sure the app at least starts up.
200
+ runE2ETest ( {
201
+ appName,
202
+ appPath,
203
+ } ) ;
204
+ } else {
205
+ runUpdateTest ( {
203
206
appName,
204
207
appPath,
205
208
autoUpdatable,
206
209
testName : 'AUTO_UPDATE_FROM' ,
207
210
} ) ;
208
- } finally {
209
- if ( server . pid ) {
210
- console . log ( 'Stopping auto-update server' ) ;
211
- kill ( server . pid , 'SIGINT' ) ;
212
- } else {
213
- console . log ( 'cannnot stop auto-update server because no pid' ) ;
214
- }
215
211
}
216
212
} finally {
217
213
await uninstall ( ) ;
@@ -263,19 +259,12 @@ function startAutoUpdateServer({
263
259
} ) ;
264
260
}
265
261
266
- type RunTestOptions = {
262
+ type RunE2ETestOptions = {
267
263
appName : string ;
268
264
appPath : string ;
269
- autoUpdatable ?: boolean ;
270
- testName : string ;
271
265
} ;
272
266
273
- function runTest ( {
274
- appName,
275
- appPath,
276
- autoUpdatable,
277
- testName,
278
- } : RunTestOptions ) {
267
+ function runE2ETest ( { appName, appPath } : RunE2ETestOptions ) {
279
268
execute (
280
269
'npm' ,
281
270
[
@@ -285,23 +274,72 @@ function runTest({
285
274
'--workspace' ,
286
275
'compass-e2e-tests' ,
287
276
'--' ,
288
- '--test-filter=auto-update ' ,
277
+ '--test-filter=time-to-first-query ' ,
289
278
] ,
290
279
{
291
280
// We need to use a shell to get environment variables setup correctly
292
281
shell : true ,
293
282
env : {
294
283
...process . env ,
295
- HADRON_AUTO_UPDATE_ENDPOINT_OVERRIDE : 'http://localhost:8080' ,
296
- AUTO_UPDATE_UPDATABLE : ( ! ! autoUpdatable ) . toString ( ) ,
297
- TEST_NAME : testName ,
298
284
COMPASS_APP_NAME : appName ,
299
285
COMPASS_APP_PATH : appPath ,
300
286
} ,
301
287
}
302
288
) ;
303
289
}
304
290
291
+ type RunUpdateTestOptions = {
292
+ appName : string ;
293
+ appPath : string ;
294
+ autoUpdatable ?: boolean ;
295
+ testName : string ;
296
+ } ;
297
+
298
+ function runUpdateTest ( {
299
+ appName,
300
+ appPath,
301
+ autoUpdatable,
302
+ testName,
303
+ } : RunUpdateTestOptions ) {
304
+ const server = startAutoUpdateServer ( {
305
+ allowDowngrades : true ,
306
+ port : 8080 ,
307
+ } ) ;
308
+ try {
309
+ execute (
310
+ 'npm' ,
311
+ [
312
+ 'run' ,
313
+ '--unsafe-perm' ,
314
+ 'test-packaged' ,
315
+ '--workspace' ,
316
+ 'compass-e2e-tests' ,
317
+ '--' ,
318
+ '--test-filter=auto-update' ,
319
+ ] ,
320
+ {
321
+ // We need to use a shell to get environment variables setup correctly
322
+ shell : true ,
323
+ env : {
324
+ ...process . env ,
325
+ HADRON_AUTO_UPDATE_ENDPOINT_OVERRIDE : 'http://localhost:8080' ,
326
+ AUTO_UPDATE_UPDATABLE : ( ! ! autoUpdatable ) . toString ( ) ,
327
+ TEST_NAME : testName ,
328
+ COMPASS_APP_NAME : appName ,
329
+ COMPASS_APP_PATH : appPath ,
330
+ } ,
331
+ }
332
+ ) ;
333
+ } finally {
334
+ if ( server . pid ) {
335
+ console . log ( 'Stopping auto-update server' ) ;
336
+ kill ( server . pid , 'SIGINT' ) ;
337
+ } else {
338
+ console . log ( 'cannnot stop auto-update server because no pid' ) ;
339
+ }
340
+ }
341
+ }
342
+
305
343
run ( )
306
344
. then ( function ( ) {
307
345
console . log ( 'done' ) ;
0 commit comments