From c706040c31626c8208bc2c5cbc9d4d57f380f3ec Mon Sep 17 00:00:00 2001 From: gavin Date: Mon, 16 Oct 2023 18:24:16 +0530 Subject: [PATCH] ci: Add Coveragerc (#22530) --- .coveragerc | 23 +++++++++++++++++++++++ .github/workflows/server-tests.yml | 4 +++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000000..e570d9403b --- /dev/null +++ b/.coveragerc @@ -0,0 +1,23 @@ +[run] +omit = + tests/* + .github/* + commands/* + **/test_*.py + +[report] +exclude_lines = + pragma: no cover + if TYPE_CHECKING: + +exclude_also = + def __repr__ + if self.debug: + if settings.DEBUG + raise AssertionError + raise NotImplementedError + if 0: + if __name__ == .__main__.: + if TYPE_CHECKING: + class .*\bProtocol\): + @(abc\.)?abstractmethod diff --git a/.github/workflows/server-tests.yml b/.github/workflows/server-tests.yml index 8533f3cbfe..f485a9d6b6 100644 --- a/.github/workflows/server-tests.yml +++ b/.github/workflows/server-tests.yml @@ -130,12 +130,14 @@ jobs: DB: ${{ matrix.db }} - name: Run Tests - run: cd ~/frappe-bench/sites && ../env/bin/python3 ../apps/frappe/.github/helper/ci.py + run: ../env/bin/python3 ../apps/frappe/.github/helper/ci.py + working-directory: /home/runner/frappe-bench/sites env: SITE: test_site CI_BUILD_ID: ${{ github.run_id }} BUILD_NUMBER: ${{ matrix.container }} TOTAL_BUILDS: 2 + COVERAGE_RCFILE: /home/runner/frappe-bench/apps/frappe/.coveragerc - name: Show bench output if: ${{ always() }}