From ecb342fd4e5f6b44dad58453c123f62547f7fc63 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Fri, 16 Aug 2024 03:32:23 +0200 Subject: [PATCH] testers.testVersion: ignore echoed store paths Fixes the error mode where the test always passes if the store path of the binary is echoed by the test command. --- pkgs/build-support/testers/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/testers/default.nix b/pkgs/build-support/testers/default.nix index d0d88115003f..737c47bcc321 100644 --- a/pkgs/build-support/testers/default.nix +++ b/pkgs/build-support/testers/default.nix @@ -53,7 +53,7 @@ command ? "${package.meta.mainProgram or package.pname or package.name} --version", version ? package.version, }: runCommand "${package.name}-test-version" { nativeBuildInputs = [ package ]; meta.timeout = 60; } '' - if output=$(${command} 2>&1); then + if output=$(${command} 2>&1 | sed -e 's|${builtins.storeDir}/[^/ ]*/|{{storeDir}}/|g'); then if grep -Fw -- "${version}" - <<< "$output"; then touch $out else