diff --git a/.circleci/config.yml b/.circleci/config.yml index e3fa8cdbd2a..7809e71a527 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3171,6 +3171,13 @@ jobs: name: Run owned integration contracts command: bash .circleci/scripts/run_integration.sh << parameters.suite >> << parameters.mode >> no_output_timeout: 15m + - when: + condition: + equal: [mcp, << parameters.suite >>] + steps: + - codecov/upload: + file: test-results/integration-mcp/conformance-coverage.xml + flags: mcp-conformance - run: name: Stop owned database and Redis when: always diff --git a/.circleci/scripts/run_integration.sh b/.circleci/scripts/run_integration.sh index 2ad001af5f4..a42e8280354 100644 --- a/.circleci/scripts/run_integration.sh +++ b/.circleci/scripts/run_integration.sh @@ -212,6 +212,12 @@ if [ "$suite" = browser ]; then exit 0 fi +test_command=(.venv/bin/python tests/integration/run.py "$suite" --results "$results") +if [ "$suite" = mcp ]; then + test_command=(.venv/bin/python -m coverage run --rcfile=tests/integration/conformance_coverage.toml \ + tests/integration/run.py "$suite" --results "$results") +fi + env -i PATH="$PATH" HOME="$HOME" PYTHONPATH="$PYTHONPATH" \ INTEGRATION_RUN_ID="$integration_identity" \ DATABASE_URL="$DATABASE_URL" REDIS_HOST="$REDIS_HOST" REDIS_PORT="$REDIS_PORT" \ @@ -226,7 +232,16 @@ env -i PATH="$PATH" HOME="$HOME" PYTHONPATH="$PYTHONPATH" \ INTEGRATION_PROXY_READ_REPLICA_URL="$INTEGRATION_PROXY_READ_REPLICA_URL" \ INTEGRATION_ROUTING="$INTEGRATION_ROUTING" \ MCP_CONFORMANCE_ROOT="${MCP_CONFORMANCE_ROOT:-}" \ - .venv/bin/python tests/integration/run.py "$suite" --results "$results" + COVERAGE_FILE="$PWD/$results/.coverage-conformance" "${test_command[@]}" + +if [ "$suite" = mcp ]; then + export COVERAGE_FILE="$PWD/$results/.coverage-conformance" + .venv/bin/python -m coverage run --rcfile=tests/integration/conformance_coverage.toml \ + -m pytest tests/unit/integration_support/test_conformance.py -q + .venv/bin/python -m coverage combine --rcfile=tests/integration/conformance_coverage.toml + .venv/bin/python -m coverage xml --rcfile=tests/integration/conformance_coverage.toml \ + -o "$results/conformance-coverage.xml" +fi if [ "${INTEGRATION_COVERAGE:-0}" = 1 ]; then for covered_pid in "$proxy_pid" "$peer_pid"; do diff --git a/tests/integration/conformance_coverage.toml b/tests/integration/conformance_coverage.toml new file mode 100644 index 00000000000..05fc59533b1 --- /dev/null +++ b/tests/integration/conformance_coverage.toml @@ -0,0 +1,9 @@ +[tool.coverage.run] +branch = true +parallel = true +relative_files = true +patch = ["subprocess"] +include = ["tests/integration/_support/conformance.py"] + +[tool.coverage.report] +show_missing = true