From a582e4c485977d62c02b65e94d25eb5d2b283037 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sat, 19 Mar 2022 14:46:53 -0400 Subject: [PATCH] HydraTestContext: add \n's to various dies --- src/script/hydra-eval-jobset | 2 +- t/lib/HydraTestContext.pm | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/script/hydra-eval-jobset b/src/script/hydra-eval-jobset index 99277fd4..8bafe07c 100755 --- a/src/script/hydra-eval-jobset +++ b/src/script/hydra-eval-jobset @@ -801,7 +801,7 @@ sub checkJobsetWrapped { next unless $job->{constituents}; if (defined $job->{error}) { - die "aggregate job ‘$job->{jobName}’ failed with the error: $job->{error}"; + die "aggregate job ‘$job->{jobName}’ failed with the error: $job->{error}\n"; } my $x = $drvPathToId{$job->{drvPath}} or diff --git a/t/lib/HydraTestContext.pm b/t/lib/HydraTestContext.pm index ce05b581..237fcbe4 100644 --- a/t/lib/HydraTestContext.pm +++ b/t/lib/HydraTestContext.pm @@ -145,7 +145,7 @@ sub nix_state_dir { sub makeAndEvaluateJobset { my ($self, %opts) = @_; - my $expression = $opts{'expression'} || die "Mandatory 'expression' option not passed to makeAndEvaluateJobset."; + my $expression = $opts{'expression'} || die "Mandatory 'expression' option not passed to makeAndEvaluateJobset.\n"; my $jobsdir = $opts{'jobsdir'} // $self->jobsdir; my $should_build = $opts{'build'} // 0; @@ -155,13 +155,13 @@ sub makeAndEvaluateJobset { ); my $jobset = $jobsetCtx->{"jobset"}; - evalSucceeds($jobset) or die "Evaluating jobs/$expression should exit with return code 0"; + evalSucceeds($jobset) or die "Evaluating jobs/$expression should exit with return code 0.\n"; my $builds = {}; for my $build ($jobset->builds) { if ($should_build) { - runBuild($build) or die "Build '".$build->job."' from jobs/$expression should exit with return code 0"; + runBuild($build) or die "Build '".$build->job."' from jobs/$expression should exit with return code 0.\n"; $build->discard_changes(); } @@ -184,7 +184,7 @@ sub makeAndEvaluateJobset { sub makeJobset { my ($self, %opts) = @_; - my $expression = $opts{'expression'} || die "Mandatory 'expression' option not passed to makeJobset."; + my $expression = $opts{'expression'} || die "Mandatory 'expression' option not passed to makeJobset.\n"; my $jobsdir = $opts{'jobsdir'} // $self->jobsdir; # Create a new user for this test @@ -227,7 +227,7 @@ sub DESTROY sub write_file { my ($path, $text) = @_; - open(my $fh, '>', $path) or die "Could not open file '$path' $!"; + open(my $fh, '>', $path) or die "Could not open file '$path' $!\n."; print $fh $text || ""; close $fh; }