From 12a7b5737d49c0018d584082accb0b1d05218533 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 4 Dec 2011 22:50:03 +0100 Subject: [PATCH] Test environment cleanups In particular, clear $NIX_BUILD_HOOK to prevent tests from failing mysteriously. Also print stdout/stderr output of hydra-evaluator. --- tests/Makefile.am | 5 +++-- tests/Setup.pm | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 718070e4..e491353c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -9,6 +9,7 @@ TESTS_ENVIRONMENT = \ NIX_MANIFESTS_DIR="$(abs_builddir)/nix/var/nix/manifests" \ NIX_STORE_DIR="$(abs_builddir)/nix/store" \ 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/c:$$PATH \ perl -w @@ -24,7 +25,7 @@ TESTS = \ evaluation-tests.pl clean : - chmod -R a+w nix + chmod -R a+w nix || true rm -rf db.sqlite data nix git-repo hg-repo svn-repo svn-checkout svn-checkout-repo bzr-repo bzr-checkout-repo check_SCRIPTS = db.sqlite repos @@ -51,7 +52,7 @@ git-repo : hg-repo : hg init hg-repo touch hg-repo/hg-file - (cd hg-repo; hg add hg-file ; hg commit -m "add hg file" hg-file) + (cd hg-repo; hg add hg-file ; hg commit -m "add hg file" hg-file -u foobar) svn-repo : svnadmin create svn-repo diff --git a/tests/Setup.pm b/tests/Setup.pm index dd0cc8e8..c005e1c4 100644 --- a/tests/Setup.pm +++ b/tests/Setup.pm @@ -59,8 +59,11 @@ sub createJobsetWithOneInput { sub evalSucceeds { my ($jobset) = @_; - my ($res) = captureStdoutStderr(60, ("../src/script/hydra-evaluator", $jobset->project->name, $jobset->name)); + my ($res, $stdout, $stderr) = captureStdoutStderr(60, ("../src/script/hydra-evaluator", $jobset->project->name, $jobset->name)); + chomp $stdout; chomp $stderr; print STDERR "Evaluation errors for jobset ".$jobset->project->name.":".$jobset->name.": \n".$jobset->errormsg."\n" if $jobset->errormsg; + print STDERR "STDOUT: $stdout\n" if $stdout ne ""; + print STDERR "STDERR: $stderr\n" if $stderr ne ""; return $res; }