Attempt to fix errors during test teardown

This commit is contained in:
Graham Christensen
2021-12-08 13:31:34 -05:00
parent a466d53d18
commit eca09bc980
4 changed files with 156 additions and 80 deletions

View File

@ -2,21 +2,15 @@ use feature 'unicode_strings';
use strict;
use warnings;
use Setup;
my %ctx = test_init();
require Hydra::Schema;
require Hydra::Model::DB;
use Test2::V0;
my $db = Hydra::Model::DB->new;
hydra_setup($db);
my $ctx = test_context();
my $db = $ctx->db;
my $project = $db->resultset('Projects')->create({name => "tests", displayname => "", owner => "root"});
# Most basic test case, no parameters
my $jobset = createBaseJobset("basic", "basic.nix", $ctx{jobsdir});
my $jobset = createBaseJobset("basic", "basic.nix", $ctx->jobsdir);
ok(evalSucceeds($jobset), "Evaluating jobs/basic.nix should exit with return code 0");
is(nrQueuedBuildsForJobset($jobset), 3, "Evaluating jobs/basic.nix should result in 3 builds");