From 1047b7079231124d520ecda9deabd7eb82afc89d Mon Sep 17 00:00:00 2001 From: Andrew Shumway Date: Tue, 18 Apr 2023 13:51:48 -0600 Subject: [PATCH] Added fail coverage threshold under 50% --- .github/workflows/checks.yml | 6 ++++-- Makefile | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 0e9535f73..c2e958f90 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -46,8 +46,10 @@ jobs: run: pipenv run flake8 . - name: Check imports alphabetized run: pipenv run isort --check-only ./app ./tests - - name: Run tests - run: pipenv run pytest -n4 --maxfail=10 + - name: Run tests with coverage + run: pipenv run coverage run --omit=*/notifications_utils/* -m pytest -n4 --maxfail=10 + - name: Check coverage threshold + run: pipenv run coverage report --fail-under=50 env: SQLALCHEMY_DATABASE_TEST_URI: postgresql://user:password@localhost:5432/test_notification_api diff --git a/Makefile b/Makefile index 990327956..625c761db 100644 --- a/Makefile +++ b/Makefile @@ -56,8 +56,8 @@ test: export NEW_RELIC_ENVIRONMENT=test test: ## Run tests and create coverage report pipenv run flake8 . pipenv run isort --check-only ./app ./tests - pipenv run coverage run -m pytest -n4 --maxfail=10 - pipenv run coverage report + pipenv run coverage run --omit=*/notifications_utils/* -m pytest -n4 --maxfail=10 + pipenv run coverage report --fail-under=50 pipenv run coverage html -d .coverage_cache .PHONY: freeze-requirements