1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00

test: Move unusual-logging to run only in logging test case

This commit is contained in:
Robert Hensing 2024-12-09 17:18:10 +01:00
parent 03d4bfd852
commit 1421420e86
3 changed files with 19 additions and 15 deletions

View file

@ -33,20 +33,6 @@ let
outputHash = "1dq9p0hnm1y75q2x40fws5887bq1r840hzdxak0a9djbwvx0b16d";
};
unusual-logging = mkDerivation {
name = "unusual-logging";
buildCommand = ''
{
echo "@nix 1"
echo "@nix {}"
echo '@nix {"action": null}'
echo '@nix {"action": 123}'
echo '@nix ]['
} >&$NIX_LOG_FD
touch $out
'';
};
in
mkDerivation {
name = "dependencies-top";
@ -56,7 +42,6 @@ mkDerivation {
input1_drv = input1;
input2_drv = input2;
input0_drv = input0;
unusual_logging_drv = unusual-logging;
fod_input_drv = fod_input;
meta.description = "Random test package";
}

View file

@ -28,3 +28,6 @@ outp="$(nix-build -E \
test -d "$outp"
nix log "$outp"
# Build works despite ill-formed structured build log entries.
expectStderr 0 nix build -f ./logging/unusual-logging.nix --no-link | grepQuiet 'warning: Unable to handle a JSON message from the derivation builder:'

View file

@ -0,0 +1,16 @@
let
inherit (import ../config.nix) mkDerivation;
in
mkDerivation {
name = "unusual-logging";
buildCommand = ''
{
echo "@nix 1"
echo "@nix {}"
echo '@nix {"action": null}'
echo '@nix {"action": 123}'
echo '@nix ]['
} >&$NIX_LOG_FD
touch $out
'';
}