Skip to content

Commit

Permalink
Merge branch 'backend/feature/db-models' of https://github.com/SELab-…
Browse files Browse the repository at this point in the history
…2/UGent-3 into backend/feature/db-models
  • Loading branch information
JibrilExe committed Feb 23, 2024
2 parents 2312254 + 1dbabf2 commit 763ec84
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
working-directory: ./frontend
run: npm run lint
Backend-tests:
runs-on: self-hosted
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

Expand All @@ -53,7 +53,7 @@ jobs:

- name: Running tests
working-directory: ./backend
run: pytest
run: sudo bash ./run_tests.sh

- name: Run linting
working-directory: ./backend
Expand Down
6 changes: 0 additions & 6 deletions backend/Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,5 @@ RUN apt-get update
RUN apt-get install -y --no-install-recommends python3-pip
RUN pip3 install --no-cache-dir -r requirements.txt -r dev-requirements.txt

# Set environment variables
ENV POSTGRES_USER=test_user
ENV POSTGRES_PASSWORD=test_password
ENV POSTGRES_DB=test_database
ENV POSTGRES_HOST=postgres

# Command to run the tests
CMD ["pytest"]
14 changes: 12 additions & 2 deletions backend/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,25 @@ services:
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_password
POSTGRES_DB: test_database
healthcheck:
test: ["CMD-SHELL", "pg_isready -U test_user -d test_database"]
interval: 5s
timeout: 3s
retries: 3
start_period: 5s

test-runner:
build:
context: .
dockerfile: Dockerfile.test
depends_on:
- postgres
postgres:
condition: service_healthy
environment:
POSTGRES_HOST: postgres # Use the service name defined in Docker Compose
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_password
POSTGRES_DB: test_database
volumes:
- .:/app
command: ["pytest"]
command: ["pytest"]

0 comments on commit 763ec84

Please sign in to comment.