From 0ca24335dbe254ff5d6250d5f7ab514de96c4071 Mon Sep 17 00:00:00 2001 From: Bryan Rumsey Date: Fri, 20 May 2022 10:27:27 -0400 Subject: [PATCH 1/4] Added a run coverage script. --- run_coverage.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 run_coverage.sh diff --git a/run_coverage.sh b/run_coverage.sh new file mode 100755 index 00000000..b566b0e3 --- /dev/null +++ b/run_coverage.sh @@ -0,0 +1,7 @@ +#!/bin/bash +#pip3 install coverage +#pip3 install python-libsbml + +coverage run --source=spatialpy test/run_unit_tests.py -m develop +coverage run --source=spatialpy test/run_integration_tests.py -m develop +coverage html From 13530f1fd7edfe6f58f8f50a19ef7de00fcf835d Mon Sep 17 00:00:00 2001 From: Bryan Rumsey Date: Fri, 20 May 2022 10:28:36 -0400 Subject: [PATCH 2/4] Added a module to contain the unittest files. --- test/unit_tests/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test/unit_tests/__init__.py diff --git a/test/unit_tests/__init__.py b/test/unit_tests/__init__.py new file mode 100644 index 00000000..e69de29b From d2f9a6a8e064df472bd1c902ac9844a18319cfb7 Mon Sep 17 00:00:00 2001 From: Bryan Rumsey Date: Fri, 20 May 2022 10:36:24 -0400 Subject: [PATCH 3/4] Moved the unittest files into the unittests module. --- test/run_unit_tests.py | 6 +++--- test/{ => unit_tests}/test_parameter.py | 0 test/{ => unit_tests}/test_reaction.py | 0 test/{ => unit_tests}/test_species.py | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename test/{ => unit_tests}/test_parameter.py (100%) rename test/{ => unit_tests}/test_reaction.py (100%) rename test/{ => unit_tests}/test_species.py (100%) diff --git a/test/run_unit_tests.py b/test/run_unit_tests.py index 48e360cc..8c994dca 100755 --- a/test/run_unit_tests.py +++ b/test/run_unit_tests.py @@ -28,9 +28,9 @@ print('Running unit tests in develop mode. Appending repository directory to system path.') sys.path.append(os.path.join(os.path.dirname(__file__), '..')) - import test_species - import test_parameter - import test_reaction + from unit_tests import test_species + from unit_tests import test_parameter + from unit_tests import test_reaction modules = [ test_species, diff --git a/test/test_parameter.py b/test/unit_tests/test_parameter.py similarity index 100% rename from test/test_parameter.py rename to test/unit_tests/test_parameter.py diff --git a/test/test_reaction.py b/test/unit_tests/test_reaction.py similarity index 100% rename from test/test_reaction.py rename to test/unit_tests/test_reaction.py diff --git a/test/test_species.py b/test/unit_tests/test_species.py similarity index 100% rename from test/test_species.py rename to test/unit_tests/test_species.py From 976725a07ebc2e7fbc599933ecfd0994eedeab46 Mon Sep 17 00:00:00 2001 From: Bryan Rumsey Date: Fri, 20 May 2022 10:39:03 -0400 Subject: [PATCH 4/4] Added source args to coverage calls in testing github actions. --- .github/workflows/run-integration-tests.yml | 2 +- .github/workflows/run-unit-tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-integration-tests.yml b/.github/workflows/run-integration-tests.yml index 7ef06084..3e28bca4 100644 --- a/.github/workflows/run-integration-tests.yml +++ b/.github/workflows/run-integration-tests.yml @@ -27,4 +27,4 @@ jobs: python3 -m pip install coverage - name: Run tests - run: coverage run test/run_integration_tests.py + run: coverage run --source=spatialpy test/run_integration_tests.py diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml index cabdc656..cebbd7b8 100644 --- a/.github/workflows/run-unit-tests.yml +++ b/.github/workflows/run-unit-tests.yml @@ -25,4 +25,4 @@ jobs: python3 -m pip install coverage - name: Run tests - run: coverage run test/run_unit_tests.py + run: coverage run --source=spatialpy test/run_unit_tests.py