refactor: use configurable running service for Python integration tests#2186
Open
refactor: use configurable running service for Python integration tests#2186
Conversation
chenba
commented
Apr 2, 2026
| -f docker-compose.e2e.mysql.yaml \ | ||
| -f docker/docker-compose.mysql.yaml \ | ||
| -f docker/docker-compose.e2e.mysql.yaml \ | ||
| -f docker/docker-compose.e2e.mysql.no-jwk-cache.yaml \ |
Collaborator
Author
There was a problem hiding this comment.
Since we cannot unset env vars with docker-compose, the order here matters, which is why we unset JWK env vars from the invoking shell and run the tests with no local JWKs, and then set the JWK env vars for the tests that follow.
chenba
commented
Apr 2, 2026
| SYNC_TOKENSERVER__FXA_OAUTH_SERVER_URL=$${SYNC_TOKENSERVER__FXA_OAUTH_SERVER_URL:-http://localhost:6000} \ | ||
| TOKENSERVER_HOST=$${TOKENSERVER_HOST:-http://localhost:8000} \ | ||
| poetry -C tools/integration_tests \ | ||
| run pytest . --ignore=tokenserver/test_e2e.py |
Collaborator
Author
There was a problem hiding this comment.
Naming is hard. e2e for the make target here is consistent with the docker-compose based tests but kinda amusing we are skipping a file named test_e2e.
chenba
commented
Apr 2, 2026
| PYTHONPATH=$(PWD)/tools \ | ||
| SYNC_MASTER_SECRET=$${SYNC_MASTER_SECRET:-secret0} \ | ||
| SYNC_TOKENSERVER__FXA_OAUTH_SERVER_URL=$${SYNC_TOKENSERVER__FXA_OAUTH_SERVER_URL:-http://localhost:6000} \ | ||
| TOKENSERVER_HOST=$${TOKENSERVER_HOST:-http://localhost:8000} \ |
Collaborator
Author
There was a problem hiding this comment.
Since we support multiple db backends, I did not include default db urls here.
5e89100 to
639b79e
Compare
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'
639b79e to
00698c2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
maketarget, '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:
Closes STOR-511