forked from lix-project/hydra
RunCommandLogs.t: use test_context to get a specific build
Fixes a build error: Can't use global @_ in 'my' at Schema/Result/RunCommandLogs.t line 20, near ', @_'
This commit is contained in:
parent
2f382ba067
commit
06360bfbb6
|
@ -1,23 +1,16 @@
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Setup;
|
use Setup;
|
||||||
|
|
||||||
my %ctx = test_init();
|
|
||||||
|
|
||||||
require Hydra::Schema;
|
|
||||||
require Hydra::Model::DB;
|
|
||||||
|
|
||||||
use Test2::V0;
|
use Test2::V0;
|
||||||
|
|
||||||
my $db = Hydra::Model::DB->new;
|
my $ctx = test_context();
|
||||||
hydra_setup($db);
|
my $db = $ctx->db();
|
||||||
|
|
||||||
my $project = $db->resultset('Projects')->create({name => "tests", displayname => "", owner => "root"});
|
my $builds = $ctx->makeAndEvaluateJobset(
|
||||||
my $jobset = createBaseJobset("basic", "basic.nix", $ctx{jobsdir});
|
expression => "basic.nix",
|
||||||
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 ($build, @_) = queuedBuildsForJobset($jobset);
|
my $build = $builds->{"empty_dir"};
|
||||||
|
|
||||||
sub new_run_log {
|
sub new_run_log {
|
||||||
return $db->resultset('RunCommandLogs')->create({
|
return $db->resultset('RunCommandLogs')->create({
|
||||||
|
@ -27,7 +20,6 @@ sub new_run_log {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
subtest "Not yet started" => sub {
|
subtest "Not yet started" => sub {
|
||||||
my $runlog = new_run_log();
|
my $runlog = new_run_log();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue