Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .azuredevops/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
21 changes: 21 additions & 0 deletions tests/unit/infra/test_integration_test_batches.py
Original file line number Diff line number Diff line change
@@ -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
Loading