Skip to content

chore: improve e2e test infrastructure for local development#1042

Open
KonstantinMirin wants to merge 2 commits intoprebid:mainfrom
KonstantinMirin:chore/fix-e2e-test-infrastructure
Open

chore: improve e2e test infrastructure for local development#1042
KonstantinMirin wants to merge 2 commits intoprebid:mainfrom
KonstantinMirin:chore/fix-e2e-test-infrastructure

Conversation

@KonstantinMirin
Copy link

@KonstantinMirin KonstantinMirin commented Feb 13, 2026

Summary

  • Align run_all_tests.sh with docker-compose.e2e.yml for full-service coverage during local test runs
  • Introduce dynamic port support in e2e tests via environment variables (A2A_PORT, ADCP_SALES_PORT, ADMIN_UI_PORT)
  • Relocate inventory profile media buy tests to tests/integration/ with proper fixture usage
  • Correct A2A compliance test message format and CORS test configuration

Motivation

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 using docker-compose.yml instead, 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.sh uses to avoid collisions with running dev environments.

Changes

run_all_tests.sh: Now uses docker-compose.e2e.yml directly, 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, and test_landing_pages.py now 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 (role and kind fields), corrected default auth token to match CI initialization, and fixed payload extraction to use the correct field name (kind instead of type). The a2a_url fixture now depends on docker_services_e2e to ensure database initialization runs before compliance tests.

CORS test: Updated to send Origin header, which is required for CORS middleware to return Access-Control-Allow-Origin (standard behavior per the CORS specification).

Inventory profile tests: These tests exercise _create_media_buy_impl directly with the mock adapter and don't require a running server. Moved to tests/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.yml topology and documented accordingly.

Results

Metric Before After
E2e tests passing locally 45 73
Tests actually exercised 54 76 (73 pass + 3 xfail)
Skips (intentional) 30 8 (production, auth token, GAM)

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 passed
  • Standalone uv run pytest tests/e2e/ without docker — graceful skips, no crashes

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant