Skip to content

Commit

Permalink
Test Flask app in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
steventux committed Jan 7, 2025
1 parent 2b2e146 commit 76d3d4b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/stage-2-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,23 @@ jobs:
- name: "Save the linting result"
run: |
echo "Nothing to save"
test-flask:
name: "Test Flask application"
needs: set-up-dependencies
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: "Checkout code"
uses: actions/checkout@v4

- name: "Install dependencies"
run: |
pip install pipenv
pipenv install --dev --system
- name: "Run Flask test suite"
run: |
./test-app.sh
test-unit:
name: "Unit tests"
needs: set-up-dependencies
Expand Down
10 changes: 5 additions & 5 deletions test-integration.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
docker compose --env-file .env.test --profile test-integration run --build integration-tests pytest -v /tests/integration
test_exit_code=$?
docker compose --env-file .env.test --profile test-integration down db --volumes
exit $test_exit_code

pytest -vv tests/integration || {
echo "Tests failed in tests/integration"
exit 1
}
2 changes: 0 additions & 2 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

./test-setup.sh
./test-unit.sh
./test-pacts.sh
./test-integration.sh
./test-end-to-end.sh
7 changes: 0 additions & 7 deletions tests/integration/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +0,0 @@
import os
import sys

SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.dirname(SCRIPT_DIR) + "/../src/functions/message_status/")
sys.path.insert(0, os.path.dirname(SCRIPT_DIR) + "/../src/functions/notify/")
sys.path.insert(0, os.path.dirname(SCRIPT_DIR) + "/../src/shared/")

0 comments on commit 76d3d4b

Please sign in to comment.