diff --git a/docs/test_codeblocks_manifest.py b/docs/test_codeblocks_manifest.py index 03c9b14e..70255062 100644 --- a/docs/test_codeblocks_manifest.py +++ b/docs/test_codeblocks_manifest.py @@ -34,6 +34,7 @@ ENVIRONMENT_RUNNERS = { "freebsd": "ubuntu-24.04", "openbsd": "ubuntu-24.04", } +CI_ENVIRONMENTS = {"ubuntu", "root", "docker", "macos"} SCENARIOS = {"project", "collection", "system", "system-data", "docker", "docker-data"} FENCE_START = re.compile(r"^(?P[ \t]*)(?P`{3,}|~{3,})[ \t]*(?P[^\n]*)$") HTML_PRE = re.compile( @@ -274,6 +275,7 @@ def matrix() -> dict[str, list[dict[str, str]]]: snippets = validate_all() records = load_manifest() environments = {records[snippet.id]["environment"] for snippet in snippets if records[snippet.id]["disposition"] == "run"} + ci_environments = environments.intersection(CI_ENVIRONMENTS) include = [ { "name": environment, @@ -281,12 +283,14 @@ def matrix() -> dict[str, list[dict[str, str]]]: "runner": ENVIRONMENT_RUNNERS[environment], } for environment in ENVIRONMENT_RUNNERS - if environment in environments + if environment in ci_environments ] assigned_ids = [snippet.id for snippet in snippets if records[snippet.id]["disposition"] == "run"] assert include, "At least one deterministic documentation example must run in CI" assert len(set(assigned_ids)) == len(assigned_ids) - assert {entry["environment"] for entry in include} == environments, "Every runnable snippet environment must have exactly one CI lane" + assert {entry["environment"] for entry in include} == ci_environments, ( + "Every selected CI documentation environment must have exactly one lane" + ) return {"include": include}