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