show evaluation errors in log of tests

This commit is contained in:
Rob Vermaas 2011-03-17 10:29:01 +00:00
parent 5db13c92b2
commit bf2f86d3c6
2 changed files with 7 additions and 3 deletions

View file

@ -24,7 +24,7 @@ clean :
chmod -R a+w nix
rm -rf db.sqlite data nix git-repo hg-repo svn-repo svn-checkout svn-checkout-repo bzr-repo bzr-checkout-repo
$(TESTS) : db.sqlite dirs
$(TESTS) : db.sqlite repos
db.sqlite : $(top_srcdir)/src/sql/hydra-sqlite.sql
sqlite3 db.sqlite < $(top_srcdir)/src/sql/hydra-sqlite.sql

View file

@ -38,6 +38,8 @@ sub createJobsetWithOneSCMInput {
$jobsetinput = $jobset->jobsetinputs->create({name => "src", type => $type});
$jobsetinputals = $jobsetinput->jobsetinputalts->create({altnr => 0, value => $uri});
return $jobset;
}
sub evalSucceeds {
@ -57,8 +59,10 @@ ok( nrBuildsForJobset("tests", "basic") == 3 , "Evaluating jobs/basic.nix should
my @scminputs = ("svn", "svn-checkout", "git", "bzr", "bzr-checkout", "hg");
foreach my $scm (@scminputs) {
createJobsetWithOneSCMInput($scm, "$scm-input.nix", $scm, "$jobsBaseUri/$scm-repo");
$jobset = createJobsetWithOneSCMInput($scm, "$scm-input.nix", $scm, "$jobsBaseUri/$scm-repo");
ok(evalSucceeds("tests", $scm), "Evaluating jobs/$scm-input.nix should exit with return code 0.");
ok(nrBuildsForJobset("tests", $scm) == 1, "Evaluating jobs/$scm-input.nix should result in 1 build")
print STDERR "Evaluation errors for jobset tests:$scm: \n".$jobset->errormsg."\n" if $jobset->errormsg;
ok(nrBuildsForJobset("tests", $scm) == 1, "Evaluating jobs/$scm-input.nix should result in 1 build");
}