add basic query tests for JobStatus/LatestSucceeded/ActiveJobs

This commit is contained in:
Rob Vermaas 2011-03-16 09:01:09 +00:00
parent 0df0723b46
commit 541ce56cc6

View file

@ -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);
} }
} }