From 0a5a53eda1dcc9c5f167a00b5fa6a566f2d3f013 Mon Sep 17 00:00:00 2001 From: JochenSiegWork <135010976+JochenSiegWork@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:56:50 +0200 Subject: [PATCH] github: add package source dir to coverage (#65) * github: add package source dir to coverage - Add package source directory to the coverage call. Otherwise completely untested files not called in the unittests would slip through CI/CD pipeline. - Now completely untested files will be in the coverage report with 0% coverage. * github: add tests dir to coverage source --- .github/workflows/linting.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 6102b678..5ff97d5f 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -181,7 +181,7 @@ jobs: - name: Run unit-tests run: | # Run only the core test suite in the tests directory. - coverage run -m unittest discover tests + coverage run --source=molpipeline,tests -m unittest discover tests # Create a coverage report. Fail if the coverage is below 85%. Exclude extra packages from the report. coverage report --fail-under=85 --omit="*chemprop*","*/*chemprop*/*" @@ -204,7 +204,7 @@ jobs: - name: Run unit-tests for chemprop run: | # Run only the chemprop test suite. - coverage run -m unittest discover test_extras/test_chemprop + coverage run --source=molpipeline,tests -m unittest discover test_extras/test_chemprop # Create a coverage report. Fail if the coverage is below 85%. Include only chemprop files in the report. coverage report --fail-under=85 --include="*chemprop*","*/*chemprop*/*"