From 53b033e623040f179d4babad11f819bb856a641f Mon Sep 17 00:00:00 2001 From: Patrick Wolfert Date: Wed, 3 Apr 2024 14:06:18 -0700 Subject: [PATCH] [NO-TICKET] Don't pass the browser tests when they fail! (#3012) Don't pass the tests when they fail! --- scripts/browser-tests.ts | 9 +++++++-- scripts/utils.ts | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/browser-tests.ts b/scripts/browser-tests.ts index 4589db3aeb..235d151792 100644 --- a/scripts/browser-tests.ts +++ b/scripts/browser-tests.ts @@ -57,6 +57,7 @@ function verifyPlaywrightInstalled() { const extraArgs = argv._.map((v) => '' + v); const playwrightArgs = ['test', ...configArgs, ...extraArgs]; + let result; if (argv.docker) { // Create the array of args for the docker command const dockerArgs = [ @@ -68,7 +69,7 @@ function verifyPlaywrightInstalled() { ]; // And run docker - shI('docker', dockerArgs); + result = shI('docker', dockerArgs); } else { // To run outside of docker, we need to have Playwright installed separately verifyPlaywrightInstalled(); @@ -85,6 +86,10 @@ function verifyPlaywrightInstalled() { } // Run Playwright directly through yarn - shI('yarn', ['playwright', ...playwrightArgs], config); + result = shI('yarn', ['playwright', ...playwrightArgs], config); + } + + if (result.error || result.status !== 0) { + process.exit(result.status || 1); } })(); diff --git a/scripts/utils.ts b/scripts/utils.ts index 693fb9ff4f..4f1b8ab833 100644 --- a/scripts/utils.ts +++ b/scripts/utils.ts @@ -21,7 +21,7 @@ export function shI( args: string[], config: SpawnSyncOptionsWithBufferEncoding = {} ) { - spawnSync(command, args, { stdio: 'inherit', ...config }); + return spawnSync(command, args, { stdio: 'inherit', ...config }); } export function verifyGhInstalled() {