chore: improve e2e test infrastructure for local development#1042
Open
KonstantinMirin wants to merge 2 commits intoprebid:mainfrom
Open
chore: improve e2e test infrastructure for local development#1042KonstantinMirin wants to merge 2 commits intoprebid:mainfrom
KonstantinMirin wants to merge 2 commits intoprebid:mainfrom
Conversation
Switch run_all_tests.sh from docker-compose.yml to docker-compose.e2e.yml so all services (MCP, A2A, Admin) actually start during local test runs. Replace hardcoded ports in e2e tests with environment variable lookups to support dynamic port allocation. Move inventory profile tests from e2e to integration suite where they belong.
Fix A2A message format to match spec (add role and kind fields), correct auth token default, fix payload extraction field name, and add Origin header to CORS test. Reduces xfails from 6 to 3.
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.
Summary
run_all_tests.shwithdocker-compose.e2e.ymlfor full-service coverage during local test runsA2A_PORT,ADCP_SALES_PORT,ADMIN_UI_PORT)tests/integration/with proper fixture usageMotivation
The e2e test suite was designed around
docker-compose.e2e.yml, which starts all services (MCP, A2A, Admin) in a single container with direct port exposure. The local test runner was usingdocker-compose.ymlinstead, which is optimized for development (split services behind nginx proxy) rather than testing. This meant some services weren't directly reachable during local e2e runs, causing tests to skip or fail depending on the execution path.Additionally, several e2e tests assumed fixed port numbers, which conflicted with the dynamic port allocation that
run_all_tests.shuses to avoid collisions with running dev environments.Changes
run_all_tests.sh: Now usesdocker-compose.e2e.ymldirectly, which provides the full service stack that e2e tests expect. Health checks extended to verify MCP and A2A readiness alongside PostgreSQL before running tests.Dynamic port support: Tests in
test_a2a_endpoints_working.py,test_a2a_regression_prevention.py, andtest_landing_pages.pynow read port configuration from environment variables, consistent with how the rest of the e2e infrastructure works.A2A compliance tests: Aligned message format with A2A spec (
roleandkindfields), corrected default auth token to match CI initialization, and fixed payload extraction to use the correct field name (kindinstead oftype). Thea2a_urlfixture now depends ondocker_services_e2eto ensure database initialization runs before compliance tests.CORS test: Updated to send
Originheader, which is required for CORS middleware to returnAccess-Control-Allow-Origin(standard behavior per the CORS specification).Inventory profile tests: These tests exercise
_create_media_buy_impldirectly with the mock adapter and don't require a running server. Moved totests/integration/and updated to use the integration fixture chain (sample_tenant,integration_db) with correct AdCP schema patterns.Remaining xfails: 3 landing page tests that require nginx proxy for Host-based domain routing. These are genuinely untestable in the current
docker-compose.e2e.ymltopology and documented accordingly.Results
Test plan
./run_all_tests.sh ci tests/e2e/— 73 passed, 8 skipped, 3 xfailed./run_all_tests.sh ci tests/integration/test_inventory_profile_media_buy.py— 4 passeduv run pytest tests/e2e/without docker — graceful skips, no crashes