Add tests for "git describe --long".
[?]
Apr 30, 2012, 3:59 AM
3RL7VFKEVVQBVKLKM7ZS3M67BOGGJ3OWPARHG64AOUTZTPPYCHLQCDependencies
- [2]
PU7CQACNuse abs_builddir for svn checkout - [3]
OB7GB5DLTest environment cleanups - [4]
HE3GX5IPOptimize fetch-git. - [5]
DCHQR576add bzr-repo target - [6]
RBZRCTALhydra: fixed and re-enabled evaluation tests - [7]
OSZDLGMPadd target to make simple git/hg/svn inputs - [8]
JRVI4XTVtests: Use $(builddir) instead of `pwd`. - [9]
VOBFCHIXuse top_srcdir in stead of srcdir - [10]
HX4QYOYAadd first evaluations tests - [11]
L4AI5YL6Rename hydra_*.pl to hydra-* - [12]
V2ALOFRRFix the test - [13]
N3KBVX6GSet $PERL5LIB properly in hydra-init in "make check" - [14]
W6J4PVRPremove debug statement - [15]
WFJ3ZPRMadd tests for scm inputs - [16]
FAIJDQKZ - [17]
GAZHOBWEBetter fix - [18]
5SMQ2PLKFix tests - [19]
G2ZB6464first test, not yet in buildprocess - [20]
EDDTVGB4set BZR_HOME env var so bzr won't fail - [21]
I3TU2UJQ - [22]
ZHBEOOUQshow evaluation errors in log of tests - [23]
SBKX3YH2cleanup - [24]
AMFMXR52Provide a command ‘hydra-init’ to initialise/upgrade the database - [25]
WHS5RMPO
Change contents
- replacement in tests/Makefile.am at line 36
repos : dirs git-repo hg-repo svn-repo svn-checkout-repo bzr-repo bzr-checkout-reporepos : dirs - edit in tests/Makefile.am at line 46[5.391]→[5.67:68](∅→∅),[5.68]→[5.62:73](∅→∅),[5.73]→[5.78:196](∅→∅),[5.78]→[5.78:196](∅→∅),[5.196]→[5.74:84](∅→∅),[5.84]→[5.205:245](∅→∅),[5.205]→[5.205:245](∅→∅),[5.245]→[3.52:129](∅→∅),[3.129]→[5.312:313](∅→∅),[5.312]→[5.312:313](∅→∅),[5.313]→[5.85:96](∅→∅),[5.96]→[5.323:349](∅→∅),[5.323]→[5.323:349](∅→∅),[5.349]→[2.0:53](∅→∅),[2.53]→[5.397:509](∅→∅),[5.404]→[5.397:509](∅→∅),[5.397]→[5.397:509](∅→∅),[5.509]→[5.119:150](∅→∅),[5.150]→[5.95:180](∅→∅),[5.180]→[5.205:257](∅→∅),[5.205]→[5.205:257](∅→∅),[5.257]→[5.181:259](∅→∅),[5.259]→[5.854:855](∅→∅),[5.855]→[5.237:346](∅→∅),[5.307]→[5.237:346](∅→∅),[5.346]→[5.260:261](∅→∅)
git-repo :git init git-repotouch git-repo/git-file(cd git-repo; git add git-file ; git commit -m "add git file" git-file)hg-repo :hg init hg-repotouch hg-repo/hg-file(cd hg-repo; hg add hg-file ; hg commit -m "add hg file" hg-file -u foobar)svn-repo :svnadmin create svn-reposvn co file://$(abs_builddir)/svn-repo svn-checkouttouch svn-checkout/svn-filesvn add svn-checkout/svn-filesvn commit -m "add svn file" svn-checkout/svn-filebzr-repo :bzr init bzr-repoBZR_HOME=$(abs_builddir)/data bzr whoami "build <build@donotemail.com>" -d bzr-repotouch bzr-repo/bzr-filebzr add bzr-repo/bzr-fileBZR_HOME=$(abs_builddir)/data bzr commit -m "add bzr-file" bzr-repo/bzr-filesvn-checkout-repo :ln -s svn-repo svn-checkout-repobzr-checkout-repo :ln -s bzr-repo bzr-checkout-repo - replacement in tests/Setup.pm at line 78
my ($scm, $update, $repo) = @_;my ($res, $stdout, $stderr) = captureStdoutStderr(60, ($update, $repo));my ($scm, $update) = @_;my ($res, $stdout, $stderr) = captureStdoutStderr(60, ($update, $scm)); - replacement in tests/Setup.pm at line 81
print STDOUT "Update $scm repository: $stdout" if $stdout ne "";return $stdout ne "";my ($message, $loop, $status) = $stdout =~ m/::(.*) -- (.*) -- (.*)::/;print STDOUT "Update $scm repository: $message\n";return ($loop eq "continue", $status eq "updated"); - replacement in tests/evaluation-tests.pl at line 10
use Test::Simple tests => 48;use Test::Simple tests => 60; - replacement in tests/evaluation-tests.pl at line 55[5.1184]→[5.2279:2298](∅→∅),[5.1680]→[5.2279:2298](∅→∅),[5.2298]→[5.1655:1763](∅→∅),[5.1680]→[5.1655:1763](∅→∅),[5.1763]→[5.2299:2400](∅→∅)
# Test scm inputsmy @scminputs = ("svn", "svn-checkout", "git", "bzr", "bzr-checkout", "hg");foreach my $scm (@scminputs) {$jobset = createJobsetWithOneInput($scm, "$scm-input.nix", "src", $scm, "$jobsBaseUri/$scm-repo");# Test scm inputsmy @scminputs = ({name => "svn",nixexpr => "svn-input.nix",type => "svn",uri => "$jobsBaseUri/svn-repo",update => getcwd . "/jobs/svn-update.sh"},{name => "svn-checkout",nixexpr => "svn-checkout-input.nix",type => "svn-checkout",uri => "$jobsBaseUri/svn-checkout-repo",update => getcwd . "/jobs/svn-checkout-update.sh"},{name => "git",nixexpr => "git-input.nix",type => "git",uri => "$jobsBaseUri/git-repo",update => getcwd . "/jobs/git-update.sh"},{name => "deepgit",nixexpr => "deepgit-input.nix",type => "git",uri => "$jobsBaseUri/git-repo master 1",update => getcwd . "/jobs/git-update.sh"},{name => "bzr",nixexpr => "bzr-input.nix",type => "bzr",uri => "$jobsBaseUri/bzr-repo",update => getcwd . "/jobs/bzr-update.sh"},{name => "bzr-checkout",nixexpr => "bzr-checkout-input.nix",type => "bzr-checkout",uri => "$jobsBaseUri/bzr-checkout-repo",update => getcwd . "/jobs/bzr-checkout-update.sh"},{name => "hg",nixexpr => "hg-input.nix",type => "hg",uri => "$jobsBaseUri/hg-repo",update => getcwd . "/jobs/hg-update.sh"}); - replacement in tests/evaluation-tests.pl at line 108
my $c = 1;my $q = 1;do {# Verify that it can be fetched and queued.ok(evalSucceeds($jobset), "$c Evaluating jobs/$scm-input.nix should exit with return code 0."); $c++;ok(nrQueuedBuildsForJobset($jobset) == $q, "$c Evaluating jobs/$scm-input.nix should result in 1 build in queue"); $c++;foreach my $scm ( @scminputs ) {my $scmName = $scm->{"name"};my $nixexpr = $scm->{"nixexpr"};my $type = $scm->{"type"};my $uri = $scm->{"uri"};my $update = $scm->{"update"};$jobset = createJobsetWithOneInput($scmName, $nixexpr, "src", $type, $uri); - replacement in tests/evaluation-tests.pl at line 116
# Verify that it is deterministic and not queued again.ok(evalSucceeds($jobset), "$c Evaluating jobs/$scm-input.nix should exit with return code 0."); $c++;ok(nrQueuedBuildsForJobset($jobset) == $q, "$c Evaluating jobs/$scm-input.nix should result in $q build in queue"); $c++;my $state = 0;my $q = 0;my ($loop, $updated) = updateRepository($scmName, $update);while($loop) {my $c = 0; - replacement in tests/evaluation-tests.pl at line 122
$q++;} while(updateRepository($scm, getcwd . "/jobs/$scm-update.sh", getcwd . "/$scm-repo/"));# Verify that it can be fetched and possibly queued.ok(evalSucceeds($jobset), "$scmName:$state.$c: Evaluating nix-expression."); $c++;# Verify that the evaluation has queued a new job and evaluate again to ...if ($updated) {$q++;ok(nrQueuedBuildsForJobset($jobset) == $q, "$scmName:$state.$c: Expect $q jobs in the queue."); $c++;ok(evalSucceeds($jobset), "$scmName:$state.$c: Evaluating nix-expression again."); $c++;}# ... check that it is deterministic and not queued again.ok(nrQueuedBuildsForJobset($jobset) == $q, "$scmName:$state.$c: Expect $q jobs in the queue."); $c++;$state++;($loop, $updated) = updateRepository($scmName, $update, getcwd . "/$scmName-repo/");} - edit in tests/jobs/bzr-checkout-update.sh at line 2[4.5410]
repo="$1"STATE_FILE=$(pwd)/.bzr-checkout-stateif test -e $STATE_FILE; thenstate=$(cat $STATE_FILE)test $state -gt 1 && state=0elsestate=0;ficase $state in(0) echo "::Create repo. -- continue -- updated::"ln -s bzr-repo bzr-checkout-repo;;(*) echo "::End. -- stop -- nothing::" ;;esacecho $(($state + 1)) > $STATE_FILE - edit in tests/jobs/bzr-update.sh at line 2[4.5471]
repo="$1"STATE_FILE=$(pwd)/.bzr-stateif test -e $STATE_FILE; thenstate=$(cat $STATE_FILE)test $state -gt 1 && state=0elsestate=0;fiexport BZR_HOME; # Set by the Makefilecase $state in(0) echo "::Create repo. -- continue -- updated::"bzr init bzr-repobzr whoami "build <build@donotemail.com>" -d bzr-repotouch bzr-repo/bzr-filebzr add bzr-repo/bzr-filebzr commit -m "add bzr-file" bzr-repo/bzr-file;;(*) echo "::End. -- stop -- nothing::";;esacecho $(($state + 1)) > $STATE_FILE - file addition: deepgit-builder.sh[5.1729]
#! /bin/shset -emkdir $outcp -v $src/* $out/git describe --long > $out/Version - file addition: deepgit-input.nix[5.1729]
with import ./config.nix;{ src }:{copy =mkDerivation {name = "git-input";builder = ./scm-builder.sh;inherit src;};} - edit in tests/jobs/git-update.sh at line 2
# This script is used both by git & deepgit checks. - replacement in tests/jobs/git-update.sh at line 4
cd "$1"STATE_FILE=.staterepo=git-repoSTATE_FILE=$(pwd)/.git-state - edit in tests/jobs/git-update.sh at line 8
test $state -gt 3 && state=0 - replacement in tests/jobs/git-update.sh at line 14
(0)echo "Add new file."touch git-file-2git add git-file-2 >&2git commit -m "add git file 2" git-file-2 >&2(0) echo "::Create repo. -- continue -- updated::"git init $repocd $repotouch foogit add foogit commit -m "Add foo"git tag -a -m "First Tag." tag0git checkout -b master HEAD - replacement in tests/jobs/git-update.sh at line 23
(1)echo "Rewrite commit."echo 1 > git-file-2git add git-file-2 >&2git commit --amend -m "add git file 2" git-file-2 >&2(1) echo "::Create new commit. -- continue -- updated::"cd $repo# Increase depth to make sure the tag is not fetched by default.echo 0 > foogit add foogit commit -m "Increase depth 0"echo 1 > foogit add foogit commit -m "Increase depth 1"echo 2 > foogit add foogit commit -m "Increase depth 2"echo 0 > bargit add bargit commit -m "Add bar with 0";;(2) echo "::Amend commit. (push -f) -- continue -- updated::"cd $repoecho 1 > bargit add bargit commit --amend -m "Add bar with 1" - edit in tests/jobs/git-update.sh at line 45
(*) echo "::End. -- stop -- nothing::"rm -rf $repo;; - edit in tests/jobs/hg-update.sh at line 2[4.6027]
repo="$1"STATE_FILE=$(pwd)/.hg-stateif test -e $STATE_FILE; thenstate=$(cat $STATE_FILE)test $state -gt 1 && state=0elsestate=0;ficase $state in(0) echo "::Create repo. -- continue -- updated::"hg init hg-repotouch hg-repo/hg-filecd hg-repohg add hg-filehg commit -m "add hg file" hg-file -u foobar;;(*) echo "::End. -- stop -- nothing::" ;;esacecho $(($state + 1)) > $STATE_FILE - edit in tests/jobs/svn-checkout-update.sh at line 2[4.6078]
repo="$1"STATE_FILE=$(pwd)/.svn-checkout-stateif test -e $STATE_FILE; thenstate=$(cat $STATE_FILE)test $state -gt 1 && state=0elsestate=0;ficase $state in(0) echo "::Create repo. -- continue -- updated::"ln -s svn-repo svn-checkout-repo;;(*) echo "::End. -- stop -- nothing::" ;;esacecho $(($state + 1)) > $STATE_FILE - edit in tests/jobs/svn-update.sh at line 2[4.6139]
repo="$1"STATE_FILE=$(pwd)/.svn-stateif test -e $STATE_FILE; thenstate=$(cat $STATE_FILE)test $state -gt 1 && state=0elsestate=0;ficase $state in(0) echo "::Create repo. -- continue -- updated::"svnadmin create svn-reposvn co $repo svn-checkouttouch svn-checkout/svn-filesvn add svn-checkout/svn-filesvn commit -m "add svn file" svn-checkout/svn-file;;(*) echo "::End. -- stop -- nothing::";;esacecho $(($state + 1)) > $STATE_FILE