From a2acfef67c315174a7834d0f47afc4e053efae1b Mon Sep 17 00:00:00 2001 From: Heliozoa Date: Wed, 12 Jul 2023 11:24:28 +0300 Subject: [PATCH] Error on non-zero exit code from system test db setup script --- system-tests/src/setup/globalSetup.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/system-tests/src/setup/globalSetup.ts b/system-tests/src/setup/globalSetup.ts index 510bc96ec2c5..9395060aabfd 100644 --- a/system-tests/src/setup/globalSetup.ts +++ b/system-tests/src/setup/globalSetup.ts @@ -44,9 +44,13 @@ async function setupSystemTestDb() { // spawnSync is the easiest way to wait for the script to finish while inheriting stdio. // Using a sync method hare shoud not be a problem since this is a setup script const res = spawnSync(setupSystemTestDbScriptPath, { stdio: "inherit" }) - if (res.error) { + if (res.status != 0) { console.error("Error: Could not setup system test db.") - throw res.error + if (res.error) { + throw res.error + } else { + throw new Error(`System test db setup script returned non-zero status code ${res.status}`) + } } console.log("System test db setup complete.") } finally {