@@ -194,24 +194,20 @@ async function run() {
194194 } ) ;
195195
196196 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 ( {
203206 appName,
204207 appPath,
205208 autoUpdatable,
206209 testName : 'AUTO_UPDATE_FROM' ,
207210 } ) ;
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- }
215211 }
216212 } finally {
217213 await uninstall ( ) ;
@@ -263,19 +259,12 @@ function startAutoUpdateServer({
263259 } ) ;
264260}
265261
266- type RunTestOptions = {
262+ type RunE2ETestOptions = {
267263 appName : string ;
268264 appPath : string ;
269- autoUpdatable ?: boolean ;
270- testName : string ;
271265} ;
272266
273- function runTest ( {
274- appName,
275- appPath,
276- autoUpdatable,
277- testName,
278- } : RunTestOptions ) {
267+ function runE2ETest ( { appName, appPath } : RunE2ETestOptions ) {
279268 execute (
280269 'npm' ,
281270 [
@@ -285,23 +274,72 @@ function runTest({
285274 '--workspace' ,
286275 'compass-e2e-tests' ,
287276 '--' ,
288- '--test-filter=auto-update ' ,
277+ '--test-filter=time-to-first-query ' ,
289278 ] ,
290279 {
291280 // We need to use a shell to get environment variables setup correctly
292281 shell : true ,
293282 env : {
294283 ...process . env ,
295- HADRON_AUTO_UPDATE_ENDPOINT_OVERRIDE : 'http://localhost:8080' ,
296- AUTO_UPDATE_UPDATABLE : ( ! ! autoUpdatable ) . toString ( ) ,
297- TEST_NAME : testName ,
298284 COMPASS_APP_NAME : appName ,
299285 COMPASS_APP_PATH : appPath ,
300286 } ,
301287 }
302288 ) ;
303289}
304290
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+
305343run ( )
306344 . then ( function ( ) {
307345 console . log ( 'done' ) ;
0 commit comments