Run tests in CI

This commit is contained in:
Christa Hartsock
2022-07-01 11:45:49 -07:00
parent b51e49a662
commit bf21aa882b
2 changed files with 42 additions and 2 deletions

40
.github/workflows/checks.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: Run checks
on: [push]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_DB: db
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install dependencies
run: make bootstrap
# - name: Run style checks
# run: flake8 .
# - name: Check imports alphabetized
# run: isort --check-only ./app ./tests
- name: Run tests
run: pytest -n4 --maxfail=10
env:
SQLALCHEMY_DATABASE_TEST_URI: postgresql://postgres:password@db:5432/test_notification_api

View File

@@ -471,8 +471,8 @@ class Test(Development):
TRANSIENT_UPLOADED_LETTERS = 'test-transient-uploaded-letters' TRANSIENT_UPLOADED_LETTERS = 'test-transient-uploaded-letters'
LETTER_SANITISE_BUCKET_NAME = 'test-letters-sanitise' LETTER_SANITISE_BUCKET_NAME = 'test-letters-sanitise'
# this is overriden in jenkins and on cloudfoundry # this is overriden in CI
SQLALCHEMY_DATABASE_URI = os.getenv('SQLALCHEMY_DATABASE_URI', 'postgresql://postgres:chummy@db:5432/notification_api') SQLALCHEMY_DATABASE_URI = os.getenv('SQLALCHEMY_DATABASE_TEST_URI', 'postgresql://postgres:chummy@db:5432/test_notification_api')
CELERY = { CELERY = {
**Config.CELERY, **Config.CELERY,