From ad10ad95192014fc65e339c76dfd4ee52b03c260 Mon Sep 17 00:00:00 2001 From: Artturin Date: Tue, 17 Jan 2023 19:56:13 +0200 Subject: [PATCH 1/4] tests.kernel-config: fix error: The option `settings.NIXOS_TEST_BOOLEAN.tristate' has conflicting definition values: - In `structuredExtraConfig': "n" - In `structuredExtraConfig': "y" since https://github.com/NixOS/nixpkgs/pull/90065 yes does not silently win over no --- pkgs/test/kernel.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkgs/test/kernel.nix b/pkgs/test/kernel.nix index a4da10030332..051afa7c5113 100644 --- a/pkgs/test/kernel.nix +++ b/pkgs/test/kernel.nix @@ -27,10 +27,9 @@ let { NIXOS_FAKE_MMC_BLOCK_MINORS = freeform "64"; } # will trigger an error but the message is not great: ]; - yesWinsOverNoConfig = mkMerge [ - # default for "NIXOS_TEST_BOOLEAN" is no - { "NIXOS_TEST_BOOLEAN" = yes; } # yes wins over no by default - { "NIXOS_TEST_BOOLEAN" = no; } + mkDefaultWorksConfig = mkMerge [ + { "NIXOS_TEST_BOOLEAN" = yes; } + { "NIXOS_TEST_BOOLEAN" = lib.mkDefault no; } ]; optionalNoWins = mkMerge [ @@ -57,7 +56,7 @@ runTests { }; testYesWinsOverNo = { - expr = (getConfig yesWinsOverNoConfig)."NIXOS_TEST_BOOLEAN".tristate; + expr = (getConfig mkDefaultWorksConfig)."NIXOS_TEST_BOOLEAN".tristate; expected = "y"; }; From 44425dc5ab5dc22559582dfdee1c537630e9b0c9 Mon Sep 17 00:00:00 2001 From: Artturin Date: Tue, 17 Jan 2023 19:59:53 +0200 Subject: [PATCH 2/4] tests.kernel-config: remove test that wasn't being run it doesn't seem necessary anymore --- pkgs/test/kernel.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pkgs/test/kernel.nix b/pkgs/test/kernel.nix index 051afa7c5113..2ccd188b1edb 100644 --- a/pkgs/test/kernel.nix +++ b/pkgs/test/kernel.nix @@ -32,11 +32,6 @@ let { "NIXOS_TEST_BOOLEAN" = lib.mkDefault no; } ]; - optionalNoWins = mkMerge [ - { NIXOS_FAKE_USB_DEBUG = option yes;} - { NIXOS_FAKE_USB_DEBUG = yes;} - ]; - allOptionalRemainOptional = mkMerge [ { NIXOS_FAKE_USB_DEBUG = option yes;} { NIXOS_FAKE_USB_DEBUG = option yes;} From 40197595ce5f18e36c69a13925679971d5ec20db Mon Sep 17 00:00:00 2001 From: Artturin Date: Tue, 17 Jan 2023 20:34:36 +0200 Subject: [PATCH 3/4] test.testers: fix getAllOutputNames not found --- pkgs/build-support/testers/expect-failure.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/build-support/testers/expect-failure.sh b/pkgs/build-support/testers/expect-failure.sh index 052ee8527176..9c725d48bf34 100644 --- a/pkgs/build-support/testers/expect-failure.sh +++ b/pkgs/build-support/testers/expect-failure.sh @@ -34,6 +34,15 @@ echo "testBuildFailure: Original builder produced exit code: $r" # ----------------------------------------- # Write the build log to the default output +# +# # from stdenv setup.sh +getAllOutputNames() { + if [ -n "$__structuredAttrs" ]; then + echo "${!outputs[*]}" + else + echo "$outputs" + fi +} outs=( $(getAllOutputNames) ) defOut=${outs[0]} From 3f3ca2d90dba5431f9e573ec04c005c233a8887f Mon Sep 17 00:00:00 2001 From: Artturin Date: Tue, 17 Jan 2023 20:42:13 +0200 Subject: [PATCH 4/4] tests.testers.testBuildFailure.helloDoesNotFail: fix confusing output the output made me think that the test failed but did not fail testBuildFailure-helloDoesNotFail> Checking /nix/store/x6403x1llpk00i59cmr96iy92mx1f7hb-hello-2.12.1/testBuildFailure.log testBuildFailure-helloDoesNotFail> testBuildFailure: The builder did not fail, but a failure was expected! --- pkgs/build-support/testers/test/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/testers/test/default.nix b/pkgs/build-support/testers/test/default.nix index 26e622c8763f..0a5381b2b738 100644 --- a/pkgs/build-support/testers/test/default.nix +++ b/pkgs/build-support/testers/test/default.nix @@ -58,9 +58,10 @@ lib.recurseIntoAttrs { inherit hello; } '' echo "Checking $failed/testBuildFailure.log" - grep -F 'testBuildFailure: The builder did not fail, but a failure was expected' $failed/testBuildFailure.log + grep -F 'testBuildFailure: The builder did not fail, but a failure was expected' $failed/testBuildFailure.log >/dev/null [[ 1 = $(cat $failed/testBuildFailure.exit) ]] touch $out + echo 'All good.' ''; multiOutput = runCommand "testBuildFailure-multiOutput" {