mirror of https://github.com/snachodog/mybuddy.git
Support parallel tests in coverage
This commit is contained in:
parent
f60c7884fe
commit
0fd8f1a3a7
|
@ -10,6 +10,9 @@ source =
|
||||||
core
|
core
|
||||||
dashboard
|
dashboard
|
||||||
reports
|
reports
|
||||||
|
parallel = true
|
||||||
|
concurrency = multiprocessing
|
||||||
|
data_file = data/.coverage
|
||||||
|
|
||||||
[html]
|
[html]
|
||||||
directory = htmlcov
|
directory = htmlcov
|
||||||
|
|
13
gulpfile.js
13
gulpfile.js
|
@ -34,6 +34,10 @@ function clean() {
|
||||||
* @param cb
|
* @param cb
|
||||||
*/
|
*/
|
||||||
function coverage(cb) {
|
function coverage(cb) {
|
||||||
|
// Erase any previous coverage results.
|
||||||
|
es('pipenv run coverage erase', {stdio: 'inherit'});
|
||||||
|
|
||||||
|
// Run tests with coverage.
|
||||||
spawn(
|
spawn(
|
||||||
'pipenv',
|
'pipenv',
|
||||||
[
|
[
|
||||||
|
@ -50,13 +54,18 @@ function coverage(cb) {
|
||||||
stdio: 'inherit'
|
stdio: 'inherit'
|
||||||
}
|
}
|
||||||
).on('exit', function() {
|
).on('exit', function() {
|
||||||
// Add coverage for isolated tests.
|
// Run isolated tests with coverage.
|
||||||
config.testsConfig.isolated.forEach(function(test_name) {
|
config.testsConfig.isolated.forEach(function(test_name) {
|
||||||
es(
|
es(
|
||||||
'pipenv run coverage run -a manage.py test ' + test_name,
|
'pipenv run coverage run manage.py test ' + test_name,
|
||||||
{stdio: 'inherit'}
|
{stdio: 'inherit'}
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Combine coverage results.
|
||||||
|
es('pipenv run coverage combine', {stdio: 'inherit'});
|
||||||
|
|
||||||
|
// Execute callback.
|
||||||
cb();
|
cb();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue