Skip to content

Commit

Permalink
Dedicated compose file with minimal containers for e2e testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jonkafton committed Jan 31, 2024
1 parent 1482d15 commit 78bd021
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 9 deletions.
11 changes: 6 additions & 5 deletions .env.ci
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# This file is committed to Git. Ensure there are no secrets in it.

DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres
DEV_ENV=True
DATABASE_URL=postgres://postgres:postgres@db:5432/postgres
MITOPEN_SECURE_SSL_REDIRECT=False
MITOPEN_DB_DISABLE_SSL=True
MITOPEN_FEATURES_DEFAULT=True
OPENSEARCH_URL=localhost:9200
CELERY_TASK_ALWAYS_EAGER=True
CELERY_BROKER_URL=redis://localhost:6379/4
CELERY_RESULT_BACKEND=redis://localhost:6379/4
OPENSEARCH_URL=opensearch-node-mitopen:9200
CELERY_TASK_ALWAYS_EAGER=False
CELERY_BROKER_URL=redis://redis:6379/4
CELERY_RESULT_BACKEND=redis://redis:6379/4
TIKA_CLIENT_ONLY=True
MITOPEN_BASE_URL=http://localhost:8063/
MAILGUN_KEY=fake_mailgun_key
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/e2e-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,4 @@ jobs:
- uses: actions/checkout@v4

- name: Run web service and E2E tests
run: |
cp .env.ci .env
docker compose up e2e-tests
docker compose down
run: docker compose -f docker-compose-e2e-tests.yml up --exit-code-from e2e-tests
55 changes: 55 additions & 0 deletions docker-compose-e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
version: "3.7"

services:
db:
image: postgres:12.17
ports:
- 5432:5432
environment:
- POSTGRES_PASSWORD=postgres

nginx:
image: nginx:1.25.3
ports:
- "8063:8063"
links:
- web
volumes:
- ./config/nginx.conf:/etc/nginx/conf.d/web.conf
- ./:/src
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8063"]
interval: 30s
timeout: 10s
retries: 5

web:
build:
context: .
dockerfile: Dockerfile
environment:
PORT: 8061
env_file: .env.ci
command: ./scripts/run-django-dev.sh
stdin_open: true
tty: true
ports:
- "8061:8061"
links:
- db
volumes:
- .:/src

e2e-tests:
build:
context: e2e_testing
args:
- BASE_URL=http://web:8063
environment:
- CI=true
env_file: .env.ci
depends_on:
nginx:
condition: service_healthy
links:
- nginx

0 comments on commit 78bd021

Please sign in to comment.