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