mirror of
https://github.com/lukaszraczylo/llm-testbench.git
synced 2026-10-12 00:45:19 +00:00
fix(tests): pull the docker base image before layer inspection
BuildKit caches base layers outside the image store, so the inspect step failed on CI runners with no cached alpine image. The test now pulls explicitly and skips when the pull cannot succeed.
This commit is contained in:
@@ -387,6 +387,15 @@ func TestDelDockerLayerCountWant_GroundTruth(t *testing.T) {
|
|||||||
t.Fatalf("write app: %v", err)
|
t.Fatalf("write app: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BuildKit keeps base layers in its own cache, so alpine:3.20 is not
|
||||||
|
// guaranteed to be in the local image store even after a successful
|
||||||
|
// build below. Pull it explicitly, and treat a pull failure (offline
|
||||||
|
// host, registry rate limit) as an environment limitation rather than
|
||||||
|
// a ground-truth failure.
|
||||||
|
if out, err := exec.Command("docker", "pull", "alpine:3.20").CombinedOutput(); err != nil {
|
||||||
|
t.Skipf("docker pull alpine:3.20 unavailable: %v\n%s", err, out)
|
||||||
|
}
|
||||||
|
|
||||||
const tag = "llmtestbench-layercount-groundtruth:test"
|
const tag = "llmtestbench-layercount-groundtruth:test"
|
||||||
// #nosec G204 -- tag is a fixed literal and dir is a t.TempDir() path,
|
// #nosec G204 -- tag is a fixed literal and dir is a t.TempDir() path,
|
||||||
// never external/user-controlled input.
|
// never external/user-controlled input.
|
||||||
|
|||||||
Reference in New Issue
Block a user