Skip to content

Commit

Permalink
Fix API tests workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nas-tabchiche committed Oct 24, 2024
1 parent 74fa265 commit 8683341
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/backend-api-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
test:
runs-on: ubuntu-latest
env:
working-directory: ./backend
backend-directory: ./backend

strategy:
max-parallel: 4
Expand All @@ -39,7 +39,7 @@ jobs:
working-directory: ${{ env.backend-directory }}
run: poetry install
- name: Create environment variables file
working-directory: ${{env.working-directory}}
working-directory: ${{env.backend-directory}}
run: |
touch .env
echo DJANGO_DEBUG='True' >> .env
Expand All @@ -53,18 +53,18 @@ jobs:
echo CISO_ASSISTANT_SUPERUSER_EMAIL='' >> .env
echo CISO_ASSISTANT_URL=http://127.0.0.1:5173 >> .env
- name: Run migrations
working-directory: ${{env.working-directory}}
working-directory: ${{env.backend-directory}}
run: |
export $(grep -v '^#' .env | xargs)
poetry run python manage.py migrate
- name: Run API tests
working-directory: ${{env.working-directory}}
working-directory: ${{env.backend-directory}}
run: |
export $(grep -v '^#' .env | xargs)
poetry run pytest app_tests/api --html=pytest-report.html --self-contained-html
- uses: actions/upload-artifact@v4
if: always()
with:
name: api-tests-report
path: ${{ env.working-directory }}/pytest-report.html
path: ${{ env.backend-directory }}/pytest-report.html
retention-days: 5

0 comments on commit 8683341

Please sign in to comment.