From ff307969e598b76834e1d2891033efec5bb9df5b Mon Sep 17 00:00:00 2001 From: Abigail Hartman Date: Wed, 26 Jun 2024 18:42:53 -0700 Subject: [PATCH] Enable code coverage measurement for tests (#948) --- .github/workflows/check-test-updates.yml | 0 .github/workflows/python-app.yml | 19 +++++++++++++++++-- requirements-dev.txt | 3 ++- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/check-test-updates.yml diff --git a/.github/workflows/check-test-updates.yml b/.github/workflows/check-test-updates.yml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index cb387477d4..e0a51c9be9 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -29,7 +29,22 @@ jobs: - name: Test with pytest run: | export PYTHONPATH=$(pwd) - pytest -v --show-capture=stdout -k "not integration" + coverage run --omit=tests/integration_tests -m pytest -v --show-capture=stdout -k "not integration" + coverage report -m + coverage xml + + - name: Code Coverage Report + uses: irongut/CodeCoverageSummary@v1.3.0 + with: + filename: coverage.xml + badge: true + fail_below_min: true + format: markdown + hide_branch_rate: false + hide_complexity: true + indicators: true + output: both + thresholds: '60 80' test_windows: runs-on: @@ -47,4 +62,4 @@ jobs: - name: Test with pytest run: | $env:PYTHONPATH=$pwd - pytest -v --show-capture=stdout -k "not integration" \ No newline at end of file + pytest -v --show-capture=stdout -k "not integration" diff --git a/requirements-dev.txt b/requirements-dev.txt index ef6934204a..5c6d8330aa 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -11,4 +11,5 @@ pytest==7.4.0 pytest-asyncio==0.23.2 azure-storage-blob chardet -azure-keyvault-secrets \ No newline at end of file +azure-keyvault-secrets +coverage \ No newline at end of file