syncstorage-rs/docker/docker-compose.e2e.postgres.yaml
Barry Chen 9e89b6025e
refactor: use configurable running service for Python integration tests (#2186)
* refactor: use configurable running service for Python integration tests

Instead of configuring and starting server instances within Python as
test fixtures, simply testing against a running server.  A mix of make
target and docker-compose changes is used to achieve the same level of
test coverage that previously relied on the (re-)configure and
(re-)start of the services in conftest.py.

A new `make` target, 'run_local_e2e_tests', can be used to run the
integration tests locally.  However, the stage FxA JWT validation tests
in test_e2e.py are excluded.  Those tests rely on the JWK configuration
of the Token Server and the stage FxA API, making them less "local".
Anyone working on that specific integration can certainly invoke those
tests themselves.

This patch also:
 - deletes some duplicate docs
 - moves the docker-compose yamls into a dir name 'docker'

* Apply suggestion from @pjenvey

Co-authored-by: Philip Jenvey <pjenvey@underboss.org>

* Apply suggestion from @pjenvey

Co-authored-by: Philip Jenvey <pjenvey@underboss.org>

* Clean-up based on feedback.

* Remove integration_tests/conftest.py

* Prune yamls

---------

Co-authored-by: Philip Jenvey <pjenvey@underboss.org>
2026-04-10 12:32:57 -05:00

37 lines
1.2 KiB
YAML

services:
syncserver:
environment:
SYNC_TOKENSERVER__ENABLED: "true"
SYNC_TOKENSERVER__FXA_EMAIL_DOMAIN: api-accounts.stage.mozaws.net
SYNC_TOKENSERVER__FXA_METRICS_HASH_SECRET: secret0
SYNC_TOKENSERVER__RUN_MIGRATIONS: "true"
e2e-tests:
container_name: postgres-e2e-tests
depends_on:
mock-fxa-server:
condition: service_started
syncserver:
condition: service_healthy
sync-db:
condition: service_healthy
tokenserver-db:
condition: service_healthy
image: app:build
privileged: true
user: root
environment:
SYNC_SERVER_URL: http://syncserver:8000
TOKENSERVER_HOST: http://syncserver:8000
SYNC_MASTER_SECRET: secret0
SYNC_SYNCSTORAGE__DATABASE_URL: postgres://test:test@sync-db:5432/syncstorage
SYNC_TOKENSERVER__DATABASE_URL: postgres://test:test@tokenserver-db:5432/tokenserver
SQLALCHEMY_SILENCE_UBER_WARNING: 1
RESULTS_FILENAME: ${RESULTS_FILENAME:-postgres_integration_results.xml}
entrypoint:
- /bin/sh
- -c
- >-
PYTHONPATH=/app
pytest /app/tools/integration_tests/
--junit-xml=/${RESULTS_FILENAME}