From 40e556aee557652ea0a6230629aff12473120684 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Mon, 10 Jan 2022 16:46:19 -0500 Subject: [PATCH] tests: evalSucceeds: don't print stdout/stderr unless it fails --- t/lib/CliRunners.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/t/lib/CliRunners.pm b/t/lib/CliRunners.pm index f857d468..82f17403 100644 --- a/t/lib/CliRunners.pm +++ b/t/lib/CliRunners.pm @@ -21,10 +21,12 @@ sub evalSucceeds { my ($jobset) = @_; my ($res, $stdout, $stderr) = captureStdoutStderr(60, ("hydra-eval-jobset", $jobset->project->name, $jobset->name)); $jobset->discard_changes; # refresh from DB - chomp $stdout; chomp $stderr; - print STDERR "Evaluation errors for jobset ".$jobset->project->name.":".$jobset->name.": \n".$jobset->errormsg."\n" if $jobset->errormsg; - print STDERR "STDOUT: $stdout\n" if $stdout ne ""; - print STDERR "STDERR: $stderr\n" if $stderr ne ""; + if ($res) { + chomp $stdout; chomp $stderr; + print STDERR "Evaluation errors for jobset ".$jobset->project->name.":".$jobset->name.": \n".$jobset->errormsg."\n" if $jobset->errormsg; + print STDERR "STDOUT: $stdout\n" if $stdout ne ""; + print STDERR "STDERR: $stderr\n" if $stderr ne ""; + } return !$res; }