diff --git a/.env.ci b/.env.ci index 1712a9829d..8096b6c4b4 100644 --- a/.env.ci +++ b/.env.ci @@ -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 diff --git a/.github/workflows/e2e-testing.yml b/.github/workflows/e2e-testing.yml index 83716dee75..920e93978b 100644 --- a/.github/workflows/e2e-testing.yml +++ b/.github/workflows/e2e-testing.yml @@ -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 diff --git a/docker-compose-e2e-tests.yml b/docker-compose-e2e-tests.yml new file mode 100644 index 0000000000..cfb70eeee4 --- /dev/null +++ b/docker-compose-e2e-tests.yml @@ -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