Skip to content

Commit 1ae42a5

Browse files
chore(ci): exit with correct exit code (ionic-team#29425)
The docker script does not exit with the correct exit code when invoking commends in `execa`. You can verify this by changing `npm run test.e2e` in the script to `npm run foo` (a non-existent script). The underlying command will fail, but the parent script will still exit with exit code 0. Important: The tests themselves have always errored correctly, so this does not impact test execution. Only the invocation of the test command is impacted. This PR ensures that invoking the wrong command causes the parent script to exit with the correct code. Co-authored-by: Brandy Carney <[email protected]>
1 parent 2007a44 commit 1ae42a5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/scripts/docker.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,7 @@ if (requestHeaded && !hasHeadedConfigFiles) {
5353
console.warn(chalk.yellow.bold('\n⚠️ You are running tests in headed mode, but one or more of your headed config files was not found.\nPlease ensure that both docker-display.txt and docker-display-volume.txt have been created in the correct location.\n'));
5454
}
5555

56-
execa('docker', args, { shell: true, stdio: 'inherit' });
56+
const res = await execa('docker', args, { shell: true, stdio: 'inherit' });
57+
58+
// If underlying scripts failed this whole process should fail too
59+
process.exit(res.exitCode);

0 commit comments

Comments
 (0)