I published the test coverage report as HTML, but I don't know how to view it from CircleCI!
For those who like, I will write how to view the coverage report from CircleCI
It's pretty aggressive, so I think there's a better way. If you know any good way, please leave a comment
It doesn't matter how you put it out, but I'm going to do it with pytest
(because it's easy)
For code in the src
directory, issue an HTML coverage report in the test-reports
directory
pytest --cov=src --cov-report=html:test-reports
version: 2
jobs:
build:
docker:
- image: circleci/python:3.7.2
steps:
(abridgement)
- run:
name: run test
command: |
. venv/bin/activate
pip install pytest
pip install pytest-cov
pytest --cov=src --cov-report=html:test-reports
- store_artifacts:
path: test-reports/
destination: circleci-docs
If you do, the coverage report files will be displayed in the ʻArtifacts` part as shown in the image below.
If you step on this ʻindex.html`, you can see the coverage report! Hooray
Click the file name to see the results for each file properly
It's the end