diff --git a/.dockerignore b/.dockerignore index 0db9b552..fae825ab 100644 --- a/.dockerignore +++ b/.dockerignore @@ -25,3 +25,8 @@ benchmarks/measurements/* !benchmarks/measurements/2026-09-13-admission-policy-smoke.json # A label source of `ousast learn` (src/openultrasast/learn/sources.toml). !benchmarks/measurements/2026-09-30-harnessx-removal-baseline/pairs.json + +# The image is published on every tag, so the reserved populations stay out of it. The scan path reads neither; +# the hunter's contamination report reads them from a checkout, not from the image. +benchmarks/valid +benchmarks/unseen diff --git a/tests/test_task_images.py b/tests/test_task_images.py index 714bc138..20e9ab8f 100644 --- a/tests/test_task_images.py +++ b/tests/test_task_images.py @@ -197,3 +197,11 @@ def test_base_preserves_executor_build_toolchains(): for directory in ("doc", "man", "info"): assert f"path-exclude=/usr/share/{directory}/*" in common assert f" /usr/share/{directory}/*" in common + + +def test_reserved_populations_stay_out_of_the_image(): + patterns = [line.strip() for line in read(".dockerignore").splitlines()] + patterns = [line for line in patterns if line and not line.startswith("#")] + for population in ("benchmarks/valid", "benchmarks/unseen"): + assert population in patterns, f"{population} is not excluded from the build context" + assert not any(line.startswith(f"!{population}") for line in patterns), f"{population} is let back in"