Merge pull request #211260 from Artturin/testtweaks1

This commit is contained in:
Artturi 2023-01-19 13:12:18 +02:00 committed by GitHub
commit 3653f4ece2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 11 deletions

View File

@ -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]}

View File

@ -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" {

View File

@ -27,15 +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; }
];
optionalNoWins = mkMerge [
{ NIXOS_FAKE_USB_DEBUG = option yes;}
{ NIXOS_FAKE_USB_DEBUG = yes;}
mkDefaultWorksConfig = mkMerge [
{ "NIXOS_TEST_BOOLEAN" = yes; }
{ "NIXOS_TEST_BOOLEAN" = lib.mkDefault no; }
];
allOptionalRemainOptional = mkMerge [
@ -57,7 +51,7 @@ runTests {
};
testYesWinsOverNo = {
expr = (getConfig yesWinsOverNoConfig)."NIXOS_TEST_BOOLEAN".tristate;
expr = (getConfig mkDefaultWorksConfig)."NIXOS_TEST_BOOLEAN".tristate;
expected = "y";
};