From a695ae48d8a4ab21f0fa38e417f2d454c9e21030 Mon Sep 17 00:00:00 2001 From: Richard Lundeen Date: Fri, 13 Nov 2026 08:00:51 -0800 Subject: [PATCH] Restore integration test batch coverage Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .azuredevops/integration-tests.yml | 4 ++++ .../infra/test_integration_test_batches.py | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 tests/unit/infra/test_integration_test_batches.py diff --git a/.azuredevops/integration-tests.yml b/.azuredevops/integration-tests.yml index 76437fa34f..5109646e21 100644 --- a/.azuredevops/integration-tests.yml +++ b/.azuredevops/integration-tests.yml @@ -23,6 +23,7 @@ jobs: # Run each group in a fresh pytest process to release memory between groups. testBatches: - tests/integration/ai_recruiter + - tests/integration/backend - tests/integration/cli - tests/integration/converter - tests/integration/datasets @@ -31,6 +32,9 @@ jobs: - tests/integration/executors - tests/integration/memory - tests/integration/message_normalizer + - tests/integration/output + - tests/integration/registry - tests/integration/scenarios - tests/integration/score + - tests/integration/setup - tests/integration/targets diff --git a/tests/unit/infra/test_integration_test_batches.py b/tests/unit/infra/test_integration_test_batches.py new file mode 100644 index 0000000000..b7f3b678e6 --- /dev/null +++ b/tests/unit/infra/test_integration_test_batches.py @@ -0,0 +1,21 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT license. + +from pathlib import Path + +import yaml + + +def test_integration_batches_cover_test_directories() -> None: + repo_root = Path(__file__).resolve().parents[3] + integration_root = repo_root / "tests" / "integration" + pipeline = yaml.safe_load((repo_root / ".azuredevops" / "integration-tests.yml").read_text(encoding="utf-8")) + job = next(job for job in pipeline["jobs"] if job.get("template") == "test-job-template.yml") + batches = job["parameters"]["testBatches"] + + test_files = set(integration_root.rglob("test_*.py")) | set(integration_root.rglob("*_test.py")) + assert test_files + assert all(path.parent != integration_root for path in test_files), "Root-level integration tests need a batch" + expected = {f"tests/integration/{path.relative_to(integration_root).parts[0]}" for path in test_files} + assert len(batches) == len(set(batches)), "Integration batches must not overlap by duplication" + assert set(batches) == expected