Skip to content

Commit

Permalink
Error on non-zero exit code from system test db setup script
Browse files Browse the repository at this point in the history
  • Loading branch information
Heliozoa committed Jul 12, 2023
1 parent 8d8f827 commit a2acfef
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions system-tests/src/setup/globalSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a2acfef

Please sign in to comment.