Skip to content

Commit

Permalink
first test, not yet in buildprocess
Browse files Browse the repository at this point in the history
  • Loading branch information
rbvermaa committed Mar 16, 2011
1 parent 87d1b44 commit 0df0723
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions configure.ac
Expand Up @@ -64,6 +64,9 @@ AC_CONFIG_FILES([
src/script/hydra_queue_runner.pl
src/script/hydra_server.pl
src/script/hydra_update_gc_roots.pl
tests/Makefile
tests/query-all-tables.pl
])
AC_OUTPUT

1 change: 1 addition & 0 deletions deps.nix
Expand Up @@ -39,5 +39,6 @@ in
perlPackages.DateTime
perlPackages.DigestSHA1
perlPackages.CryptRandPasswd
perlPackages.TestMore
nixPerl
]
8 changes: 8 additions & 0 deletions tests/Makefile.am
@@ -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

19 changes: 19 additions & 0 deletions tests/query-all-tables.pl.in
@@ -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");
}
}

0 comments on commit 0df0723

Please sign in to comment.