From 385b70c89821b88588e3623b7059a9c25997dd5d Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Thu, 24 Mar 2011 13:45:01 +0000 Subject: [PATCH] hydra: fixed and re-enabled evaluation tests --- deps.nix | 17 +---------------- release.nix | 2 +- tests/Makefile.am | 6 +++--- tests/evaluation-tests.pl.in | 15 ++++++++++++++- 4 files changed, 19 insertions(+), 21 deletions(-) diff --git a/deps.nix b/deps.nix index 329e0799..5d631ebe 100644 --- a/deps.nix +++ b/deps.nix @@ -2,21 +2,6 @@ with pkgs; -let - - nixPerl = buildPerlPackage { - name = "Nix-0.15"; - src = fetchsvn { - url = https://svn.nixos.org/repos/nix/nix-perl/trunk; - rev = 24774; - sha256 = "1akj695gpnbrjlnwd1gdnnnk7ppvpp1qsinjn04az7q6hjqzbm6p"; - }; - NIX_PREFIX = nixSqlite; - doCheck = false; # tests currently don't work - }; - -in - [ perlPackages.CatalystDevel perlPackages.CatalystPluginSessionStoreFastMmap perlPackages.CatalystPluginStackTrace @@ -40,5 +25,5 @@ in perlPackages.DigestSHA1 perlPackages.CryptRandPasswd perlPackages.TestMore - nixPerl + perlPackages.nixPerl ] diff --git a/release.nix b/release.nix index 0e74b58f..56b88c5a 100644 --- a/release.nix +++ b/release.nix @@ -73,7 +73,7 @@ rec { --set NIX_RELEASE ${nix.name} done ''; # */ - + LOGNAME="$USER"; meta = { description = "Build of Hydra on ${system}"; }; diff --git a/tests/Makefile.am b/tests/Makefile.am index dc8f403b..85365d5f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -9,7 +9,7 @@ TESTS_ENVIRONMENT = \ NIX_STORE_DIR="$(abs_builddir)/nix/store" \ NIX_LOG_DIR="$(abs_builddir)/nix/var/log/nix" \ PERL5LIB="$(srcdir):$(top_srcdir)/src/lib:$$PERL5LIB" \ - PATH=$(abs_top_srcdir)/src/script:$$PATH \ + PATH=$(abs_top_srcdir)/src/script:$(abs_top_srcdir)/src/c:$$PATH \ perl -w EXTRA_DIST = \ @@ -18,8 +18,8 @@ EXTRA_DIST = \ $(wildcard jobs/*.sh) TESTS = \ - query-all-tables.pl -# evaluation-tests.pl + query-all-tables.pl \ + evaluation-tests.pl clean : chmod -R a+w nix diff --git a/tests/evaluation-tests.pl.in b/tests/evaluation-tests.pl.in index 361f80cc..5ac4daa2 100755 --- a/tests/evaluation-tests.pl.in +++ b/tests/evaluation-tests.pl.in @@ -10,7 +10,7 @@ use Setup; my $db = openHydraDB; -use Test::Simple tests => 22; +use Test::Simple tests => 28; hydra_setup($db); @@ -40,6 +40,19 @@ $jobset = createJobsetWithOneInput("build-output-as-input", "build-output-as-inp ok(evalSucceeds($jobset), "Evaluating jobs/build-output-as-input.nix should exit with return code 0"); ok(nrQueuedBuildsForJobset($jobset) == 1 , "Evaluating jobs/build-output-as-input.nix for first time should result in 1 build in queue"); +for my $build (queuedBuildsForJobset($jobset)) { + ok(runBuild($build), "Build '".$build->job->name."' from jobs/basic.nix should exit with code 0"); + my $newbuild = $db->resultset('Builds')->find($build->id); + ok($newbuild->buildresultinfo->buildstatus == 0, "Build '".$build->job->name."' from jobs/basic.nix should have buildstatus 0"); +} + +ok(evalSucceeds($jobset), "Evaluating jobs/build-output-as-input.nix for second time should exit with return code 0"); +ok(nrQueuedBuildsForJobset($jobset) == 1 , "Evaluating jobs/build-output-as-input.nix for second time after building build1 should result in 1 build in queue"); +for my $build (queuedBuildsForJobset($jobset)) { + ok(runBuild($build), "Build '".$build->job->name."' from jobs/basic.nix should exit with code 0"); + my $newbuild = $db->resultset('Builds')->find($build->id); + ok($newbuild->buildresultinfo->buildstatus == 0, "Build '".$build->job->name."' from jobs/basic.nix should have buildstatus 0"); +} # Test scm inputs