Skip to content

Commit d36aadb

Browse files
authored
Add code coverage report to tests (#138)
* Add code coverage report to tests Signed-off-by: gaugup <gaugup@microsoft.com> * Fix coverage directory Signed-off-by: gaugup <gaugup@microsoft.com> * Printing the code coverage Signed-off-by: gaugup <gaugup@microsoft.com> * Add upload code coverage stage Signed-off-by: gaugup <gaugup@microsoft.com>
1 parent 855ce7e commit d36aadb

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/pythonpackage.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,16 @@ jobs:
3838
flake8 . --count --max-complexity=30 --max-line-length=127 --statistics
3939
- name: Test with pytest
4040
run: |
41-
pytest
41+
# pytest
42+
pytest tests/ --doctest-modules --junitxml=junit/test-results.xml --cov=dice_ml --cov-report=xml --cov-report=html
43+
cat coverage.xml
44+
- name: Upload code coverage results
45+
uses: actions/upload-artifact@v2
46+
with:
47+
name: code-coverage-results
48+
path: htmlcov
49+
# Use always() to always run this step to publish test results when there are test failures
50+
if: ${{ always() }}
4251
- name: Check package consistency with twine
4352
run: |
4453
python setup.py check sdist bdist_wheel

requirements-test.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
flake8
22
pytest
3+
pytest-cov
34
twine
45
ipython
56
jsonschema

0 commit comments

Comments
 (0)