diff --git a/release.nix b/release.nix index 813c3975..9d2af8f9 100644 --- a/release.nix +++ b/release.nix @@ -154,6 +154,7 @@ in rec { gitAndTools.topGit mercurial darcs subversion bazaar openssl bzip2 guile # optional, for Guile + Guix support perlDeps perl + postgresql92 # for running the tests ]; hydraPath = lib.makeSearchPath "bin" ( diff --git a/tests/Makefile.am b/tests/Makefile.am index 8b8880f7..7a11bca5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,6 +1,6 @@ TESTS_ENVIRONMENT = \ 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_HOME="$(top_srcdir)/src" \ HYDRA_CONFIG= \ @@ -12,7 +12,7 @@ TESTS_ENVIRONMENT = \ NIX_LOG_DIR="$(abs_builddir)/nix/var/log/nix" \ NIX_BUILD_HOOK= \ 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 EXTRA_DIST = \ diff --git a/tests/set-up.pl b/tests/set-up.pl index ff72483f..63679b63 100644 --- a/tests/set-up.pl +++ b/tests/set-up.pl @@ -1,3 +1,5 @@ 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; diff --git a/tests/tear-down.pl b/tests/tear-down.pl index 32e51a87..f30bb278 100644 --- a/tests/tear-down.pl +++ b/tests/tear-down.pl @@ -1,5 +1,12 @@ 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; -system("rm -f .*-state") == 0 or die; -system("dropdb hydra-test-suite") == 0 or die; + +my $fail = 0; + +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;