first test, not yet in buildprocess

This commit is contained in:
Rob Vermaas 2011-03-16 08:50:31 +00:00
parent 87d1b447c2
commit 0df0723b46
4 changed files with 31 additions and 0 deletions

View file

@ -64,6 +64,9 @@ AC_CONFIG_FILES([
src/script/hydra_queue_runner.pl src/script/hydra_queue_runner.pl
src/script/hydra_server.pl src/script/hydra_server.pl
src/script/hydra_update_gc_roots.pl src/script/hydra_update_gc_roots.pl
tests/Makefile
tests/query-all-tables.pl
]) ])
AC_OUTPUT AC_OUTPUT

View file

@ -39,5 +39,6 @@ in
perlPackages.DateTime perlPackages.DateTime
perlPackages.DigestSHA1 perlPackages.DigestSHA1
perlPackages.CryptRandPasswd perlPackages.CryptRandPasswd
perlPackages.TestMore
nixPerl nixPerl
] ]

8
tests/Makefile.am Normal file
View file

@ -0,0 +1,8 @@
TESTS = \
query-all-tables.pl
$(TESTS) : db.sqlite
db.sqlite : $(srcdir)/src/sql/hydra-sqlite.sql
sqlite3 db.sqlite < $(srcdir)/src/sql/hydra-sqlite.sql

View file

@ -0,0 +1,19 @@
#! @perl@ -w -I@nix@/libexec/nix
use strict;
use Hydra::Schema;
use Hydra::Helper::Nix;
use Hydra::Helper::AddBuilds;
my $db = openHydraDB;
my @sources = $db->sources;
my $nrtables = scalar(@sources);
use Test::Simple tests => 62;
foreach my $source (@sources) {
if( $source !~ m/^(LatestSucceeded|JobStatus|ActiveJobs)/) {
ok(scalar($db->resultset($source)->search({},{})) == 0, "Basic select query for $source");
}
}