chore(ci): exit with correct exit code (#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 <brandyscarney@gmail.com>
This commit is contained in:
Liam DeBeasi
2024-05-10 16:40:18 -04:00
committed by GitHub
parent 2007a44a27
commit 1ae42a5c13

View File

@ -53,4 +53,7 @@ if (requestHeaded && !hasHeadedConfigFiles) {
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'));
}
execa('docker', args, { shell: true, stdio: 'inherit' });
const res = await execa('docker', args, { shell: true, stdio: 'inherit' });
// If underlying scripts failed this whole process should fail too
process.exit(res.exitCode);