diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-09-08 15:08:00 -0400 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-09-08 19:59:45 -0400 |
commit | 0e07c5521531fc4ca0b1346bf28df5ad8a5fb5a7 (patch) | |
tree | 5f625d6432f92fb32b8ec64bc32f11996b0c136e | |
parent | 3d6e198dfa0eed92414f949c84128c4c46eb6f1a (diff) | |
download | buildstream-0e07c5521531fc4ca0b1346bf28df5ad8a5fb5a7.tar.gz |
.gitlab-ci.yml: Produce combined coverage report
This report combines the coverage from the integration tests
and the pytest suite together into one report so we can see just
what parts of the code base we're covering collectively.
-rw-r--r-- | .gitlab-ci.yml | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 76069b861..4d5138ffb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ cache: stages: - test - - report + - coverage before_script: # Diagnostics @@ -23,29 +23,52 @@ before_script: # Run premerge commits # -tests: +pytest: stage: test script: - dnf install -y bzr - python3 setup.py test - - cp .coverage coverage/ + - mkdir -p coverage-pytest/ + - cp .coverage.* coverage-pytest/coverage.pytest artifacts: paths: - - coverage/ + - coverage-pytest/ # Run integration tests # -integration_tests: +integration: stage: test script: - - dnf install -y findutils bzr + - dnf install -y findutils bzr which + - pip3 install coverage - pip3 install . - git clone https://gitlab.com/BuildStream/buildstream-tests.git - cd buildstream-tests - - ./run-test.sh --arg --colors test + - git checkout test-coverage-reports + - ./run-test.sh --arg --colors --cov ../.coveragerc test + - cd .. + - mkdir -p coverage-integration/ + - cp buildstream-tests/.coverage coverage-integration/coverage.integration artifacts: paths: - - coverage/ + - coverage-integration/ + +# Collate coverage reports +# +coverage: + stage: coverage + script: + - pip3 install coverage + - pip3 install . + - mkdir report + - cp coverage-integration/coverage.integration report/.coverage + - cp coverage-pytest/coverage.pytest report + - cd report + - coverage combine --rcfile=../.coveragerc -a coverage.pytest + - coverage report -m + dependencies: + - pytest + - integration # Automatically build documentation, only for merges which land # on master branch. |