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
|
||||
dashboard
|
||||
reports
|
||||
parallel = true
|
||||
concurrency = multiprocessing
|
||||
data_file = data/.coverage
|
||||
|
||||
[html]
|
||||
directory = htmlcov
|
||||
|
|
13
gulpfile.js
13
gulpfile.js
|
@ -34,6 +34,10 @@ function clean() {
|
|||
* @param cb
|
||||
*/
|
||||
function coverage(cb) {
|
||||
// Erase any previous coverage results.
|
||||
es('pipenv run coverage erase', {stdio: 'inherit'});
|
||||
|
||||
// Run tests with coverage.
|
||||
spawn(
|
||||
'pipenv',
|
||||
[
|
||||
|
@ -50,13 +54,18 @@ function coverage(cb) {
|
|||
stdio: 'inherit'
|
||||
}
|
||||
).on('exit', function() {
|
||||
// Add coverage for isolated tests.
|
||||
// Run isolated tests with coverage.
|
||||
config.testsConfig.isolated.forEach(function(test_name) {
|
||||
es(
|
||||
'pipenv run coverage run -a manage.py test ' + test_name,
|
||||
'pipenv run coverage run manage.py test ' + test_name,
|
||||
{stdio: 'inherit'}
|
||||
);
|
||||
})
|
||||
|
||||
// Combine coverage results.
|
||||
es('pipenv run coverage combine', {stdio: 'inherit'});
|
||||
|
||||
// Execute callback.
|
||||
cb();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue