test(infra): delete the change-detector Dockerfile tests, keep the real policy check

They pinned exact Dockerfile text / an engine-stage SHA, so every legitimate image
edit broke them and the "fix" was to paste the new value back — a change-detector,
not a contract. Deleted:
- tests/test_unseen_image.py (test_image_stages) entirely.
- the Dockerfile-text assertions in test_engine_queue's image test.

Kept as a genuine contract: the rustfs least-privilege queue policy assertions
(renamed test_rustfs_engine_queue_policy). The partial-clone extraction test and
its new hermetic-git-env fixture stay — that one verifies real behaviour.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Marius Ciepluch
2026-10-12 16:02:47 +02:00
co-authored by Claude Opus 4.8
parent e49c150316
commit a36f99e15e
-22
View File
@@ -1,22 +0,0 @@
"""Static image contract; no Docker invocation."""
import hashlib
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
# The engine portion is pinned so that adding the replay stage cannot silently change the engine image.
# Recompute after an intentional engine-stage change: it is sha256 of `engine.rstrip() + "\n"` where `engine`
# is everything before the `FROM ${ENGINE_REF} AS replay` line.
ENGINE_SHA = "77c34f3381cef6c6d1f7fd761cd3924a3656cc5e6eb20c51c819de77afb4b2fc"
def test_image_stages():
text = (ROOT / "plane/Dockerfile.engine-task").read_text()
# The replay stage builds FROM the engine stage (via the ENGINE_REF arg, default `engine`).
engine, replay = text.split("FROM ${ENGINE_REF} AS replay", 1)
assert hashlib.sha256((engine.rstrip() + "\n").encode()).hexdigest() == ENGINE_SHA
# Task base is digest-pinned (no floating fallback) and built in two stages: joern-build -> engine.
assert "FROM ghcr.io/norandom/ousast-task-base:${TASK_BASE_TAG}@${TASK_BASE_DIGEST} AS joern-build" in engine
assert "FROM ghcr.io/norandom/ousast-task-base:${TASK_BASE_TAG}@${TASK_BASE_DIGEST} AS engine" in engine
# The replay stage is a pure addition on top of engine: the unseen replay harness + a smoke check.
assert "replay_entry.py" in replay and "ousast pre-push --help" in replay