forked from lix-project/hydra
Split out dependent tests in to its own .t
This commit is contained in:
parent
e4cda87b5a
commit
9590bababc
2 changed files with 35 additions and 21 deletions
34
tests/evaluate-dependent-jobsets.t
Normal file
34
tests/evaluate-dependent-jobsets.t
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
use strict;
|
||||||
|
use Cwd;
|
||||||
|
use Setup;
|
||||||
|
|
||||||
|
(my $datadir, my $pgsql) = test_init();
|
||||||
|
|
||||||
|
require Hydra::Schema;
|
||||||
|
require Hydra::Model::DB;
|
||||||
|
|
||||||
|
use Test2::V0;
|
||||||
|
|
||||||
|
my $db = Hydra::Model::DB->new;
|
||||||
|
hydra_setup($db);
|
||||||
|
|
||||||
|
# Test jobset with 2 jobs, one has parameter of succeeded build of the other
|
||||||
|
my $jobset = createJobsetWithOneInput("build-output-as-input", "build-output-as-input.nix", "build1", "build", "build1");
|
||||||
|
|
||||||
|
ok(evalSucceeds($jobset), "Evaluating jobs/build-output-as-input.nix should exit with return code 0");
|
||||||
|
ok(nrQueuedBuildsForJobset($jobset) == 1 , "Evaluating jobs/build-output-as-input.nix for first time should result in 1 build in queue");
|
||||||
|
for my $build (queuedBuildsForJobset($jobset)) {
|
||||||
|
ok(runBuild($build), "Build '".$build->job."' from jobs/basic.nix should exit with code 0");
|
||||||
|
my $newbuild = $db->resultset('Builds')->find($build->id);
|
||||||
|
ok($newbuild->finished == 1 && $newbuild->buildstatus == 0, "Build '".$build->job."' from jobs/basic.nix should have buildstatus 0");
|
||||||
|
}
|
||||||
|
|
||||||
|
ok(evalSucceeds($jobset), "Evaluating jobs/build-output-as-input.nix for second time should exit with return code 0");
|
||||||
|
ok(nrQueuedBuildsForJobset($jobset) == 1 , "Evaluating jobs/build-output-as-input.nix for second time after building build1 should result in 1 build in queue");
|
||||||
|
for my $build (queuedBuildsForJobset($jobset)) {
|
||||||
|
ok(runBuild($build), "Build '".$build->job."' from jobs/basic.nix should exit with code 0");
|
||||||
|
my $newbuild = $db->resultset('Builds')->find($build->id);
|
||||||
|
ok($newbuild->finished == 1 && $newbuild->buildstatus == 0, "Build '".$build->job."' from jobs/basic.nix should have buildstatus 0");
|
||||||
|
}
|
||||||
|
|
||||||
|
done_testing;
|
|
@ -7,7 +7,7 @@ use Setup;
|
||||||
require Hydra::Schema;
|
require Hydra::Schema;
|
||||||
require Hydra::Model::DB;
|
require Hydra::Model::DB;
|
||||||
|
|
||||||
use Test::Simple tests => 68;
|
use Test::Simple tests => 60;
|
||||||
|
|
||||||
my $db = Hydra::Model::DB->new;
|
my $db = Hydra::Model::DB->new;
|
||||||
hydra_setup($db);
|
hydra_setup($db);
|
||||||
|
@ -21,26 +21,6 @@ my $project = $db->resultset('Projects')->create({name => "tests", displayname =
|
||||||
my $jobset;
|
my $jobset;
|
||||||
|
|
||||||
|
|
||||||
# Test jobset with 2 jobs, one has parameter of succeeded build of the other
|
|
||||||
$jobset = createJobsetWithOneInput("build-output-as-input", "build-output-as-input.nix", "build1", "build", "build1");
|
|
||||||
|
|
||||||
ok(evalSucceeds($jobset), "Evaluating jobs/build-output-as-input.nix should exit with return code 0");
|
|
||||||
ok(nrQueuedBuildsForJobset($jobset) == 1 , "Evaluating jobs/build-output-as-input.nix for first time should result in 1 build in queue");
|
|
||||||
for my $build (queuedBuildsForJobset($jobset)) {
|
|
||||||
ok(runBuild($build), "Build '".$build->job."' from jobs/basic.nix should exit with code 0");
|
|
||||||
my $newbuild = $db->resultset('Builds')->find($build->id);
|
|
||||||
ok($newbuild->finished == 1 && $newbuild->buildstatus == 0, "Build '".$build->job."' from jobs/basic.nix should have buildstatus 0");
|
|
||||||
}
|
|
||||||
|
|
||||||
ok(evalSucceeds($jobset), "Evaluating jobs/build-output-as-input.nix for second time should exit with return code 0");
|
|
||||||
ok(nrQueuedBuildsForJobset($jobset) == 1 , "Evaluating jobs/build-output-as-input.nix for second time after building build1 should result in 1 build in queue");
|
|
||||||
for my $build (queuedBuildsForJobset($jobset)) {
|
|
||||||
ok(runBuild($build), "Build '".$build->job."' from jobs/basic.nix should exit with code 0");
|
|
||||||
my $newbuild = $db->resultset('Builds')->find($build->id);
|
|
||||||
ok($newbuild->finished == 1 && $newbuild->buildstatus == 0, "Build '".$build->job."' from jobs/basic.nix should have buildstatus 0");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Test scm inputs
|
# Test scm inputs
|
||||||
my @scminputs = (
|
my @scminputs = (
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue