tests: add jobsdir and testdir to ctx hash

This allows us to calculate those directories only once, and just pass
them around as necessary.
This commit is contained in:
Cole Helbling
2021-03-04 17:22:37 -08:00
parent f08d0be1bd
commit 9a3af13c51
15 changed files with 53 additions and 40 deletions

View File

@ -23,7 +23,7 @@ hydra_setup($db);
my $project = $db->resultset('Projects')->create({name => "tests", displayname => "", owner => "root"});
# Most basic test case, no parameters
my $jobset = createBaseJobset("basic", "runcommand.nix");
my $jobset = createBaseJobset("basic", "runcommand.nix", $ctx{jobsdir});
ok(evalSucceeds($jobset), "Evaluating jobs/runcommand.nix should exit with return code 0");
is(nrQueuedBuildsForJobset($jobset), 1, "Evaluating jobs/runcommand.nix should result in 1 build1");
@ -138,4 +138,4 @@ subtest "Validate the products match" => sub {
};
};
done_testing;
done_testing;