From b6884388a1281d70bb4e5bb12e1cadd34bb832f0 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sun, 25 Aug 2024 13:41:56 +0200 Subject: [PATCH] add dedicated test for hash mismatch url reporting the current test relies on derivation build order being deterministic, which will not be a reasonable expectation for all that long any more. Change-Id: I9be44a7725185f614a9a4c724045b8b1e6962c03 --- tests/functional/build.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/functional/build.sh b/tests/functional/build.sh index a540cf8fd..356985a64 100644 --- a/tests/functional/build.sh +++ b/tests/functional/build.sh @@ -134,6 +134,13 @@ nix build --impure -f multiple-outputs.nix --json e --no-link | jq --exit-status printf "" | nix build --no-link --stdin --json | jq --exit-status '. == []' printf "%s\n" "$drv^*" | nix build --no-link --stdin --json | jq --exit-status '.[0]|has("drvPath")' +# URL reporting +out="$(nix-build fod-failing.nix -A x1 2>&1)" && status=0 || status=$? +test "$status" = 102 +test "$(<<<"$out" grep -E '^error:' | wc -l)" = 1 +<<<"$out" grepQuiet -E "hash mismatch in fixed-output derivation '.*-x1\\.drv'" +<<<"$out" grepQuiet -E "likely URL: https://meow.puppy.forge/puppy.tar.gz" + # --keep-going and FOD out="$(nix build -f fod-failing.nix -L 2>&1)" && status=0 || status=$? test "$status" = 1