mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 16:15:20 +02:00
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:  # User-Facing Changes N/A # Tests + Formatting N/A # After Submitting N/A
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user