Run PostgreSQL during "make check"

This commit is contained in:
Eelco Dolstra 2015-06-25 15:51:44 +02:00
parent 18a3c3ff1c
commit b5815e2aa6
4 changed files with 17 additions and 7 deletions

View file

@ -154,6 +154,7 @@ in rec {
gitAndTools.topGit mercurial darcs subversion bazaar openssl bzip2 gitAndTools.topGit mercurial darcs subversion bazaar openssl bzip2
guile # optional, for Guile + Guix support guile # optional, for Guile + Guix support
perlDeps perl perlDeps perl
postgresql92 # for running the tests
]; ];
hydraPath = lib.makeSearchPath "bin" ( hydraPath = lib.makeSearchPath "bin" (

View file

@ -1,6 +1,6 @@
TESTS_ENVIRONMENT = \ TESTS_ENVIRONMENT = \
BZR_HOME="$(abs_builddir)/data" \ BZR_HOME="$(abs_builddir)/data" \
HYDRA_DBI="dbi:Pg:dbname=hydra-test-suite;" \ HYDRA_DBI="dbi:Pg:dbname=hydra-test-suite;port=6433" \
HYDRA_DATA="$(abs_builddir)/data" \ HYDRA_DATA="$(abs_builddir)/data" \
HYDRA_HOME="$(top_srcdir)/src" \ HYDRA_HOME="$(top_srcdir)/src" \
HYDRA_CONFIG= \ HYDRA_CONFIG= \
@ -12,7 +12,7 @@ TESTS_ENVIRONMENT = \
NIX_LOG_DIR="$(abs_builddir)/nix/var/log/nix" \ NIX_LOG_DIR="$(abs_builddir)/nix/var/log/nix" \
NIX_BUILD_HOOK= \ NIX_BUILD_HOOK= \
PERL5LIB="$(srcdir):$(top_srcdir)/src/lib:$$PERL5LIB" \ PERL5LIB="$(srcdir):$(top_srcdir)/src/lib:$$PERL5LIB" \
PATH=$(abs_top_srcdir)/src/script:$(abs_top_srcdir)/src/hydra-eval-jobs:$$PATH \ PATH=$(abs_top_srcdir)/src/script:$(abs_top_srcdir)/src/hydra-eval-jobs:$(abs_top_srcdir)/src/hydra-queue-runner:$$PATH \
perl -w perl -w
EXTRA_DIST = \ EXTRA_DIST = \

View file

@ -1,3 +1,5 @@
use strict; use strict;
system("createdb hydra-test-suite") == 0 or die; system("initdb -D postgres") == 0 or die;
system("pg_ctl -D postgres -o \"-F -p 6433 -h ''\" -w start") == 0 or die;
system("createdb -p 6433 hydra-test-suite") == 0 or die;
system("hydra-init") == 0 or die; system("hydra-init") == 0 or die;

View file

@ -1,5 +1,12 @@
use strict; use strict;
system("chmod -R a+w nix") == 0 or die;
system("rm -rf data nix git-repo hg-repo svn-repo svn-checkout svn-checkout-repo bzr-repo bzr-checkout-repo darcs-repo") == 0 or die; my $fail = 0;
system("rm -f .*-state") == 0 or die;
system("dropdb hydra-test-suite") == 0 or die; system("dropdb -p 6433 hydra-test-suite") == 0 or $fail = 1;
system("pg_ctl -D postgres -w stop") == 0 or $fail = 1;
system("chmod -R a+w nix") == 0 or $fail = 1;
system("rm -rf postgres data nix git-repo hg-repo svn-repo svn-checkout svn-checkout-repo bzr-repo bzr-checkout-repo darcs-repo") == 0 or $fail = 1;
system("rm -f .*-state") == 0 or $fail = 1;
exit $fail;