Skip to content
Snippets Groups Projects
Commit 8d83cc87 authored by Arin Wongprommoon's avatar Arin Wongprommoon
Browse files

[WIP] ci: visualise test coverage

WHY IS THIS CHANGE NEEDED?:
- CI pipeline doesn't show code coverage of tests, therefore we can't
  evaluate how well the tests are at addressing potential issues

HOW DOES THE CHANGE SOLVE THE PROBLEM?:
- copying lines from
  https://docs.gitlab.com/ee/ci/testing/test_coverage_visualization.html#python-example
  for now, as i expect it to look something like that

REFERENCES:
- issue #46

[WIP] ci: visualise test coverage

WHY IS THIS CHANGE NEEDED?:
- evaluate & visualise test coverage, so that we can be better at
  writing code tests

HOW DOES THE CHANGE SOLVE THE PROBLEM?:
- chiefly taken from
  https://git.ecdf.ed.ac.uk/help/user/project/merge_requests/test_coverage_visualization.md#python-example
  but with some functions run under poetry for consistency

WHAT SIDE EFFECTS DOES THIS CHANGE HAVE?:
- specific to GitLab 14.2.6 which we use.  coverage reports are handled
  differently in 15.0 and later versions: https://gitlab.com/gitlab-org/gitlab/-/blob/812408bafae328b81652110fc53c6c6b89e3db81/doc/ci/yaml/artifacts_reports.md#artifactsreportscoverage_report

EVIDENCE THAT COMMIT WORKS:
- minimal working environment: https://git.ecdf.ed.ac.uk/s1947236/code-coverage-sandbox/-/tree/3f11f55836a4605416508d146ae94b40af2720b8

REFERENCES:
- issue #46
parent ba5266d4
No related branches found
No related tags found
No related merge requests found
......@@ -39,6 +39,14 @@ Local Tests:
script:
# - poetry install -vv
- poetry run pytest ./tests --ignore ./tests/aliby/network --ignore ./tests/aliby/pipeline
- poetry run coverage run -m pytest
- poetry run coverage report -m
- poetry run coverage xml
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
# Legacy because we use GitLab 14.2.6
artifacts:
reports:
cobertura: coverage.xml
Network Tools Tests:
stage: tests
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment