tests.problems: only match on the error message

This drops matching on the truncated stack trace marker as that only
appears if the stack trace is actually long enough. In some cases the
stack trace is simply too short so Nix prints it out entirely. Then
the tests fail and I'm unhappy.

This was caused by a90d993610 which to the best of my understanding
forces the error message very early in the eval and thus doesn't have
a very long stack trace.
This commit is contained in:
Andreas Rammhold
2026-07-24 11:39:29 +02:00
parent da6063cbe1
commit 717e330f8e
+8 -3
View File
@@ -50,10 +50,15 @@ lib.mapAttrs (
echo "$?" > $out/code
echo "Command exited with code $(<$out/code)"
remove-references-to -t ${nixFile} $out/stderr
if grep '(stack trace truncated.*)' $out/stderr; then
sed -i -n '/(stack trace truncated.*)/,$ p' $out/stderr
fi
sed -i 's/^ //' $out/stderr
# extract only from the error message to the end, sometimes the stack
# traces are too short for nix to truncate them and then we've false
# negative CI results due to unrelated changes in nixpkgs.
if grep -q '^error: .' $out/stderr; then
sed -i -n '/^error: ./,$ p' $out/stderr
fi
'';
checker = runCommand "test-problems-check-${name}" { } ''
if ! PAGER=cat ${lib.getExe gitMinimal} diff --no-index ${