dockerTools: Test pullImage fetcher whenever its implementation changes

This commit is contained in:
Robert Hensing 2021-09-29 14:37:31 +02:00
parent 8e8b3fa1bb
commit 16a4da9127
2 changed files with 10 additions and 1 deletions

View File

@ -119,7 +119,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
with subtest("The pullImage tool works"):
docker.succeed(
"docker load --input='${examples.nixFromDockerHub}'",
"docker load --input='${examples.testNixFromDockerHub}'",
"docker run --rm nix:2.2.1 nix-store --version",
"docker rmi nix:2.2.1",
)

View File

@ -95,6 +95,15 @@ rec {
finalImageTag = "2.2.1";
finalImageName = "nix";
};
# Same example, but re-fetches every time the fetcher implementation changes.
# NOTE: Only use this for testing, or you'd be wasting a lot of time, network and space.
testNixFromDockerHub = pkgs.invalidateFetcherByDrvHash pullImage {
imageName = "nixos/nix";
imageDigest = "sha256:85299d86263a3059cf19f419f9d286cc9f06d3c13146a8ebbb21b3437f598357";
sha256 = "19fw0n3wmddahzr20mhdqv6jkjn1kanh6n2mrr08ai53dr8ph5n7";
finalImageTag = "2.2.1";
finalImageName = "nix";
};
# 5. example of multiple contents, emacs and vi happily coexisting
editors = buildImage {