Skip to content

Commit

Permalink
chore: add unit and integration test checks
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Feb 9, 2024
1 parent 113e787 commit 8f7855f
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/quality-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Open Prices unit and integration tests

on:
push:
paths:
- "**/app/**"
- "pyproject.toml"
- "poetry.lock"
- "tests/**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
unit-test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.11"

steps:
#----------------------------------------------
# check-out repo
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v3

#----------------------------------------------
# Launch checks and tests
#----------------------------------------------
- name: Configure docker
run: |
# ensure a new line for .env file might not have it!
echo "" >> .env
# align user id
echo "OFF_UID=$UID" >> .env
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> .env
- name: Launch tests
run: make tests
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ docs:
checks: toml-check flake8 black-check mypy isort-check docs


tests: unit-tests integration-tests

unit-tests:
@echo "🥫 Running tests …"
# change project name to run in isolation
Expand Down
1 change: 1 addition & 0 deletions tests/integration/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def override_get_db():
db = session()
yield db
finally:
# close the DB session
db.close()


Expand Down

0 comments on commit 8f7855f

Please sign in to comment.