From 2ddba27be5be531bc4e08c122ef1ff4569c5236f Mon Sep 17 00:00:00 2001 From: Jochen Sieg Date: Fri, 16 Aug 2024 10:14:43 +0200 Subject: [PATCH 1/2] 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/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..2e6b6f58 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 -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 -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*/*" From f33346bc2aed625c87f0e7c31784e4dc4d1ae09b Mon Sep 17 00:00:00 2001 From: Jochen Sieg Date: Fri, 16 Aug 2024 10:34:42 +0200 Subject: [PATCH 2/2] 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 2e6b6f58..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 --source=molpipeline -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 --source=molpipeline -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*/*"