Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Commit

Permalink
RunCommandLogs.t: use test_context to get a specific build
Browse files Browse the repository at this point in the history
Fixes a build error: Can't use global @_ in 'my' at Schema/Result/RunCommandLogs.t line 20, near ', @_'
  • Loading branch information
grahamc committed Dec 15, 2021
1 parent 8651723 commit e41bbe1
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions t/Schema/Result/RunCommandLogs.t
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
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"});
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");
my $builds = $ctx->makeAndEvaluateJobset(
expression => "basic.nix",
);

my ($build, @_) = queuedBuildsForJobset($jobset);
my $build = $builds->{"empty_dir"};

sub new_run_log {
return $db->resultset('RunCommandLogs')->create({
Expand All @@ -27,7 +20,6 @@ sub new_run_log {
});
}


subtest "Not yet started" => sub {
my $runlog = new_run_log();

Expand Down

0 comments on commit e41bbe1

Please sign in to comment.