It would be good to have:
- assessment of the full coverage in CI, when a new release is made
- assment of the branch coverage before a branch is merged (and preventing the merge is the coverage falls bellow a certain threshold)
The blocking point is that the full CI takes a long time and is split into different places (circle ci, github actions etc.)
A possible implementation would be to:
- have circleci generate some coverage with unique names
̀yaml
- run:
name: Run tests (shard N)
command: |
python -m pytest grid2op/tests/
--cov=grid2op
--cov-branch
--cov-report= \ # no report yet, just raw data
--cov-append
-p no:randomly # keep shards deterministic
mv .coverage .coverage.shard_$CIRCLE_NODE_INDEX
̀
- then combine everything :
̀yaml
- run:
name: Merge and report coverage
command: |
pip install coverage
coverage combine .coverage.shard_* # merges all partial files
coverage report --branch --fail-under=80
coverage xml -o coverage.xml
̀
A problem is that it does not take into account github.
It would be good to have:
The blocking point is that the full CI takes a long time and is split into different places (circle ci, github actions etc.)
A possible implementation would be to:
̀yamlname: Run tests (shard N)
command: |
python -m pytest grid2op/tests/
--cov=grid2op
--cov-branch
--cov-report= \ # no report yet, just raw data
--cov-append
-p no:randomly # keep shards deterministic
mv .coverage .coverage.shard_$CIRCLE_NODE_INDEX
̀̀yamlname: Merge and report coverage
command: |
pip install coverage
coverage combine .coverage.shard_* # merges all partial files
coverage report --branch --fail-under=80
coverage xml -o coverage.xml
̀A problem is that it does not take into account github.