From 5569f5beff965e61ae49faf9fdacf0bfb02c9ab6 Mon Sep 17 00:00:00 2001 From: 132ikl <132@ikl.sh> Date: Tue, 15 Jul 2025 07:28:13 -0400 Subject: [PATCH] Print errors during stdlib testing (#16128) # Description This PR adds error output display for stdlib tests. This makes it easier to understand why a test is failing. Here's what an example error output looks like: ![image](https://github.com/user-attachments/assets/ed06b53e-c3f9-4c56-a646-7e6486ce7ec6) # User-Facing Changes N/A # Tests + Formatting N/A # After Submitting N/A --- crates/nu-std/testing.nu | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/crates/nu-std/testing.nu b/crates/nu-std/testing.nu index ae2b225a3c..1c8c65d42a 100644 --- a/crates/nu-std/testing.nu +++ b/crates/nu-std/testing.nu @@ -240,13 +240,15 @@ def run-tests-for-module [ log info $"Running ($test.test) in module ($module.name)" log debug $"Global context is ($global_context)" - $test|insert result {|x| - run-test $test $plugins - | if $in.exit_code == 0 { - 'pass' - } else { - 'fail' - } + $test | insert result { run-test $test $plugins } + } + | collect # Avoid interleaving errors + | update result {|test| + if $in.exit_code == 0 { + 'pass' + } else { + log error $"Error while running ($test.test) in module ($module.name)(char nl)($in.stderr)" + 'fail' } } | append $skipped_tests