mirror of https://github.com/snachodog/mybuddy.git
Also handle exit codes on coverage run
This commit is contained in:
parent
c0d20e3a94
commit
95670c7b31
15
gulpfile.js
15
gulpfile.js
|
@ -53,20 +53,28 @@ function coverage(cb) {
|
|||
{
|
||||
stdio: 'inherit'
|
||||
}
|
||||
).on('exit', function() {
|
||||
).on('exit', function(code) {
|
||||
// Run isolated tests with coverage.
|
||||
config.testsConfig.isolated.forEach(function(test_name) {
|
||||
if (code === 0) {
|
||||
try {
|
||||
config.testsConfig.isolated.forEach(function (test_name) {
|
||||
es(
|
||||
'pipenv run coverage run manage.py test ' + test_name,
|
||||
{stdio: 'inherit'}
|
||||
);
|
||||
})
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
cb();
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Combine coverage results.
|
||||
es('pipenv run coverage combine', {stdio: 'inherit'});
|
||||
}
|
||||
|
||||
// Execute callback.
|
||||
cb();
|
||||
process.exit(code)
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -205,6 +213,7 @@ function test(cb) {
|
|||
es('pipenv run python manage.py test ' + test_name, {stdio: 'inherit'});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
cb();
|
||||
process.exit(1);
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue