diff --git a/.dockerignore b/.dockerignore index fae825ab..56ee9ac0 100644 --- a/.dockerignore +++ b/.dockerignore @@ -30,3 +30,7 @@ benchmarks/measurements/* # the hunter's contamination report reads them from a checkout, not from the image. benchmarks/valid benchmarks/unseen + +# The search pilot's working files are git-ignored (.gitignore), so a checkout never has them; a local +# build context does. +benchmarks/search/private/ diff --git a/tests/test_task_images.py b/tests/test_task_images.py index 20e9ab8f..4687aaee 100644 --- a/tests/test_task_images.py +++ b/tests/test_task_images.py @@ -205,3 +205,13 @@ def test_reserved_populations_stay_out_of_the_image(): 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" + + +def test_search_pilot_files_stay_out_of_the_image(): + """The search pilot's working files are git-ignored, so a checkout never has them; a local build context does.""" + patterns = [line.strip() for line in read(".dockerignore").splitlines()] + patterns = [line for line in patterns if line and not line.startswith("#")] + private = "benchmarks/search/private/" + assert private in patterns, f"{private} is not excluded from the build context" + # Docker cleans each line, so `!benchmarks/search/private` lets the directory back in as well. + assert not any(line.startswith(f"!{private}".rstrip("/")) for line in patterns), f"{private} is let back in"