From ae38cc5d040d668ab5d55bf8e9e0077d04778fd8 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Mon, 10 Jan 2022 16:47:22 -0500 Subject: [PATCH] test_context: support an override on jobsdir when creating a jobset --- t/lib/HydraTestContext.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/t/lib/HydraTestContext.pm b/t/lib/HydraTestContext.pm index 43806c6f..9f9db4f2 100644 --- a/t/lib/HydraTestContext.pm +++ b/t/lib/HydraTestContext.pm @@ -125,12 +125,14 @@ sub jobsdir { # Hash Parameters: # # * expression: The file in the jobsdir directory to evaluate +# * jobsdir: An alternative jobsdir to source the expression from # * build: Bool. Attempt to build all the resulting jobs. Default: false. sub makeAndEvaluateJobset { my ($self, %opts) = @_; my $expression = $opts{'expression'} || die "Mandatory 'expression' option not passed to makeAndEValuateJobset."; my $should_build = $opts{'build'} // 0; + my $jobsdir = $opts{'jobsdir'} // $self->jobsdir; # Create a new user for this test @@ -155,7 +157,7 @@ sub makeAndEvaluateJobset { emailoverride => "" }); my $jobsetinput = $jobset->jobsetinputs->create({name => "jobs", type => "path"}); - $jobsetinput->jobsetinputalts->create({altnr => 0, value => $self->jobsdir}); + $jobsetinput->jobsetinputalts->create({altnr => 0, value => $jobsdir}); evalSucceeds($jobset) or die "Evaluating jobs/$expression should exit with return code 0";