From cc90480cdbb5734d5655b764a85038b6951843c2 Mon Sep 17 00:00:00 2001 From: Will Usher Date: Fri, 15 Dec 2023 13:25:55 +0100 Subject: [PATCH 1/2] Update coveralls workflow to use lcov --- .github/workflows/python.yaml | 4 +--- setup.cfg | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index d891110c..835a4e48 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -31,6 +31,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' - run: | - pip install --upgrade coveralls - coveralls --service=github + uses: coverallsapp/github-action@v2 diff --git a/setup.cfg b/setup.cfg index 7fbcbb43..f033876c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -87,7 +87,7 @@ console_scripts = # CAUTION: --cov flags may prohibit setting breakpoints while debugging. # Comment those flags to avoid this pytest issue. addopts = - --cov otoole --cov-report html + --cov otoole --cov-report lcov --verbose -s # --log-cli-level=10 From d9bccb55b5930d58a23fa1b12267b13299612c70 Mon Sep 17 00:00:00 2001 From: Will Usher Date: Fri, 15 Dec 2023 13:35:18 +0100 Subject: [PATCH 2/2] Added note about coverage in contributing docs --- docs/contributing.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/contributing.rst b/docs/contributing.rst index 31d3c73a..96bdfb1d 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -196,6 +196,10 @@ Find more detailed information in `creating a PR`_. You might also want to open the PR as a draft first and mark it as ready for review after the feedbacks from the continuous integration (CI) system or any required fixes. +We track test coverage using coveralls_. You can check the coverage +of your PR by clicking on the "details" link in the "Coverage" section of +the pull request checks. Try to ensure that your pull requests always increase +test coverage. Troubleshooting --------------- @@ -281,6 +285,7 @@ on PyPI_, the following steps can be used to release a new version for .. |tox| replace:: ``tox`` +.. _coveralls: https://coveralls.io/github/OSeMOSYS/otoole .. _black: https://pypi.org/project/black/ .. _CommonMark: https://commonmark.org/ .. _contribution-guide.org: https://www.contribution-guide.org/