forked from lix-project/hydra
add basic query tests for JobStatus/LatestSucceeded/ActiveJobs
This commit is contained in:
parent
0df0723b46
commit
541ce56cc6
|
@ -3,17 +3,21 @@
|
||||||
use strict;
|
use strict;
|
||||||
use Hydra::Schema;
|
use Hydra::Schema;
|
||||||
use Hydra::Helper::Nix;
|
use Hydra::Helper::Nix;
|
||||||
use Hydra::Helper::AddBuilds;
|
|
||||||
|
|
||||||
my $db = openHydraDB;
|
my $db = openHydraDB;
|
||||||
|
|
||||||
my @sources = $db->sources;
|
my @sources = $db->sources;
|
||||||
my $nrtables = scalar(@sources);
|
my $nrtables = scalar(@sources);
|
||||||
|
|
||||||
use Test::Simple tests => 62;
|
use Test::Simple tests => 74;
|
||||||
|
|
||||||
foreach my $source (@sources) {
|
foreach my $source (@sources) {
|
||||||
|
my $title = "Basic select query for $source";
|
||||||
if( $source !~ m/^(LatestSucceeded|JobStatus|ActiveJobs)/) {
|
if( $source !~ m/^(LatestSucceeded|JobStatus|ActiveJobs)/) {
|
||||||
ok(scalar($db->resultset($source)->search({},{})) == 0, "Basic select query for $source");
|
ok(scalar($db->resultset($source)->all) == 0, $title);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ok(scalar($db->resultset($source)->search({},{ bind => ["", "", ""] })) == 0, $title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue