Bubble up exit code when tests fail

This commit is contained in:
Christopher C. Wells 2021-05-04 06:02:44 -07:00
parent f5c1248fbd
commit c0d20e3a94
1 changed files with 13 additions and 8 deletions

View File

@ -197,15 +197,20 @@ function test(cb) {
'isolate' 'isolate'
]; ];
command = command.concat(process.argv.splice(3)); command = command.concat(process.argv.splice(3));
spawn('pipenv', command, { stdio: 'inherit' }).on('exit', function() { spawn('pipenv', command, { stdio: 'inherit' }).on('exit', function(code) {
if (code === 0) {
// Run isolated tests. // Run isolated tests.
config.testsConfig.isolated.forEach(function(test_name) { config.testsConfig.isolated.forEach(function(test_name) {
es( try {
'pipenv run python manage.py test ' + test_name, es('pipenv run python manage.py test ' + test_name, {stdio: 'inherit'});
{stdio: 'inherit'} } catch (error) {
); console.error(error);
process.exit(1);
}
}) })
}
cb(); cb();
process.exit(code);
}); });
} }