From 3a5f077bbf201bd2eff75e1f6122671911832496 Mon Sep 17 00:00:00 2001 From: george Date: Thu, 3 Feb 2022 21:08:38 +0000 Subject: [PATCH] Improve and refactor testing. --- .github/workflows/main.yml | 2 +- coverage.ini | 10 ++++++++++ pytest.ini | 5 +++++ scripts/run-test.sh | 2 +- 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 coverage.ini create mode 100644 pytest.ini diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2aa35bac..ac667360 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,7 +65,7 @@ jobs: - name: Test with pytest run: | - pytest --cov=. --cov-report=term:skip-covered --cov-report=html:htmlcov --cov-fail-under=60 + pytest - name: Archive code coverage results uses: actions/upload-artifact@v2 diff --git a/coverage.ini b/coverage.ini new file mode 100644 index 00000000..dc571cc8 --- /dev/null +++ b/coverage.ini @@ -0,0 +1,10 @@ +[run] +branch = True +source = . + +[report] +fail_under = 55 +omit = + app/fake_data.py + oauth_tester.py +skip_covered = True diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 00000000..f0b84317 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,5 @@ +[pytest] +addopts = + --cov + --cov-config coverage.ini + --cov-report=html:htmlcov diff --git a/scripts/run-test.sh b/scripts/run-test.sh index c1acb060..f8b21f10 100644 --- a/scripts/run-test.sh +++ b/scripts/run-test.sh @@ -9,4 +9,4 @@ sleep 5 poetry run pytest -docker rm -f sl-test-db \ No newline at end of file +docker rm -f sl-test-db