Skip to content

Commit

Permalink
Dev: publish backend test results to Github Actions (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwitkowski authored Aug 3, 2024
1 parent 5dfdff3 commit a3bf27a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/cd-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ env:
jobs:
build-api:
runs-on: ubuntu-latest
permissions: write-all

steps:
- uses: actions/checkout@v4
Expand All @@ -40,6 +41,13 @@ jobs:
run: |
./run_tests.sh
- name: 'Publish Test Results'
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
./backend/test-results/**/*.xml
- name: 'Build Backend API'
working-directory: ./backend
run: |
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
*.log
__pycache__
node_modules
db/prod_dump_2024_06_31.sql
db/prod_dump_2024_06_31.sql
backend/test-results
2 changes: 1 addition & 1 deletion backend/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export PYTHONPATH=$PYTHONPATH':./'

python3 -m unittest -v
python3 -m xmlrunner -o ./test-results

if [[ $? -ne 0 ]]; then
exit 1
Expand Down
1 change: 1 addition & 0 deletions backend/tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ ddt==1.7.2
psycopg==3.2.1
pytest==8.3.2
testcontainers[postgres]==4.7.2
unittest-xml-reporting==3.2.0

0 comments on commit a3bf27a

Please sign in to comment.