forked from lix-project/hydra
Fix tests
This commit is contained in:
parent
1f268d2d43
commit
fa62c8b7f2
|
@ -3,6 +3,7 @@ package Setup;
|
||||||
use strict;
|
use strict;
|
||||||
use Exporter;
|
use Exporter;
|
||||||
use Hydra::Helper::Nix;
|
use Hydra::Helper::Nix;
|
||||||
|
use Hydra::Model::DB;
|
||||||
use Hydra::Helper::AddBuilds;
|
use Hydra::Helper::AddBuilds;
|
||||||
use Cwd;
|
use Cwd;
|
||||||
|
|
||||||
|
@ -32,7 +33,8 @@ sub nrQueuedBuildsForJobset {
|
||||||
sub createBaseJobset {
|
sub createBaseJobset {
|
||||||
my ($jobsetName, $nixexprpath) = @_;
|
my ($jobsetName, $nixexprpath) = @_;
|
||||||
|
|
||||||
my $project = openHydraDB->resultset('Projects')->update_or_create({name => "tests", displayname => "", owner => "root"});
|
my $db = Hydra::Model::DB->new;
|
||||||
|
my $project = $db->resultset('Projects')->update_or_create({name => "tests", displayname => "", owner => "root"});
|
||||||
my $jobset = $project->jobsets->create({name => $jobsetName, nixexprinput => "jobs", nixexprpath => $nixexprpath, emailoverride => ""});
|
my $jobset = $project->jobsets->create({name => $jobsetName, nixexprinput => "jobs", nixexprpath => $nixexprpath, emailoverride => ""});
|
||||||
|
|
||||||
my $jobsetinput;
|
my $jobsetinput;
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
use strict;
|
use strict;
|
||||||
use Hydra::Schema;
|
use Hydra::Schema;
|
||||||
use Hydra::Helper::Nix;
|
use Hydra::Model::DB;
|
||||||
use Hydra::Helper::AddBuilds;
|
use Hydra::Helper::AddBuilds;
|
||||||
use Cwd;
|
use Cwd;
|
||||||
|
|
||||||
use Setup;
|
use Setup;
|
||||||
|
|
||||||
my $db = openHydraDB;
|
my $db = Hydra::Model::DB->new;
|
||||||
|
|
||||||
use Test::Simple tests => 28;
|
use Test::Simple tests => 28;
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
use strict;
|
use strict;
|
||||||
use Hydra::Schema;
|
use Hydra::Schema;
|
||||||
use Hydra::Helper::Nix;
|
use Hydra::Model::DB;
|
||||||
|
|
||||||
my $db = openHydraDB;
|
my $db = Hydra::Model::DB->new;
|
||||||
|
|
||||||
my @sources = $db->sources;
|
my @sources = $db->schema->sources;
|
||||||
my $nrtables = scalar(@sources);
|
my $nrtables = scalar(@sources);
|
||||||
|
|
||||||
use Test::Simple tests => 42;
|
use Test::Simple tests => 42;
|
||||||
|
@ -15,8 +15,7 @@ foreach my $source (@sources) {
|
||||||
ok(scalar($db->resultset($source)->all) == 1, $title);
|
ok(scalar($db->resultset($source)->all) == 1, $title);
|
||||||
} elsif( $source !~ m/^(LatestSucceeded|JobStatus|ActiveJobs)/) {
|
} elsif( $source !~ m/^(LatestSucceeded|JobStatus|ActiveJobs)/) {
|
||||||
ok(scalar($db->resultset($source)->all) == 0, $title);
|
ok(scalar($db->resultset($source)->all) == 0, $title);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
ok(scalar($db->resultset($source)->search({},{ bind => ["", "", ""] })) == 0, $title);
|
ok(scalar($db->resultset($source)->search({},{ bind => ["", "", ""] })) == 0, $title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue