Merge pull request #237 from GSA/notify-230

Add coverage report to API
This commit is contained in:
Ryan Ahearn
2023-04-19 16:05:45 -04:00
committed by GitHub
3 changed files with 10 additions and 4 deletions

View File

@@ -46,10 +46,12 @@ 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
env:
SQLALCHEMY_DATABASE_TEST_URI: postgresql://user:password@localhost:5432/test_notification_api
- name: Check coverage threshold
run: pipenv run coverage report --fail-under=50
validate-new-relic-config:
runs-on: ubuntu-latest

2
.gitignore vendored
View File

@@ -44,6 +44,7 @@ pip-delete-this-directory.txt
htmlcov/
.tox/
.coverage
.coverage_cache
.coverage.*
.cache
.pytest_cache
@@ -76,6 +77,7 @@ environment.sh
varsfile
celerybeat-schedule
celerybeat-schedule.db
# CloudFoundry
.cf

View File

@@ -53,10 +53,12 @@ generate-version-file: ## Generates the app version file
.PHONY: test
test: export NEW_RELIC_ENVIRONMENT=test
test: ## Run tests
test: ## Run tests and create coverage report
pipenv run flake8 .
pipenv run isort --check-only ./app ./tests
pipenv run pytest -n4 --maxfail=10
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
freeze-requirements: ## Pin all requirements including sub dependencies into requirements.txt