ZTYKNDOLJNMR2WNAUVFJDIIY5J4ICINEP4AHHBNZA3DGVG5GL7EQC 3G475GRT37NX3C5DGLQMOZ6RPPFOWTAF7TJHZA6533WT73PDJ7EAC HX4QYOYAKKFKK4KF6SZ6FQCM5ZF7ZFDTQUR4GS5WPPTYZASYZZUAC RBZRCTALK2SLKX6HDMBS25BRNYPK3GK364MGAVCXP3MW5CEW5TKQC ZHBEOOUQS46RWOJUV4AFCKI7JDASDNGT7KVSHPJK7DRBXW7SSROAC SBKX3YH2EOCYY2IDACGOTXHJZSYSRHD5EC7FB6WGPKHLFYOF6SAAC WFJ3ZPRMZ52NFPPGRJTVNLYLFFN2DYP3JHNTPVRQAEULEF7VCGGAC 3RL7VFKEVVQBVKLKM7ZS3M67BOGGJ3OWPARHG64AOUTZTPPYCHLQC ABB3BIS2X3MOXUJD5CUEODSJ3QCRZ4YDSNME2AHNCPG5OJ2F2I5QC L7RW467ZBDYCV332DAVH5PBVTCVQXNJXACVNZJTU5Y5H6P62X52QC S5NPXZG34PZZ5FIIAQ2IO72G6PAQC4JZ2WS2CVKTO623BNQKGMHAC W6J4PVRPLX2IBH2KO4A5DSZBJUJYFJ3LYBSP4YKJIDFBXYVD2DWQC HE3GX5IPS6XA7KLNP5WZY2YU27WQS663WSKAL5FHWBSJ5GMM633AC PY5GVGC7QVTOTCZ52LRHUCUJY5MER6ADCMTC2FR2WQACQV4QV5CQC G2ZB6464XGPBIMSZIPSB24EIXSCCGV4XWC3IWPS2CXYPDSUZSU5QC # 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 => "git-rev",nixexpr => "git-rev-input.nix",type => "git",uri => "$jobsBaseUri/git-repo 7f60df502b96fd54bbfa64dd94b56d936a407701",update => getcwd . "/jobs/git-rev-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"},{name => "darcs",nixexpr => "darcs-input.nix",type => "darcs",uri => "$jobsBaseUri/darcs-repo",update => getcwd . "/jobs/darcs-update.sh"});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);my $state = 0;my $q = 0;my ($loop, $updated) = updateRepository($scmName, $update);while($loop) {my $c = 0;# 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/");}}
use strict;use Cwd;use Setup;(my $datadir, my $pgsql) = test_init();require Hydra::Schema;require Hydra::Model::DB;use Test2::V0;my $db = Hydra::Model::DB->new;hydra_setup($db);my $jobsBaseUri = "file://".getcwd;# 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 => "git-rev",nixexpr => "git-rev-input.nix",type => "git",uri => "$jobsBaseUri/git-repo 7f60df502b96fd54bbfa64dd94b56d936a407701",update => getcwd . "/jobs/git-rev-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"},{name => "darcs",nixexpr => "darcs-input.nix",type => "darcs",uri => "$jobsBaseUri/darcs-repo",update => getcwd . "/jobs/darcs-update.sh"});foreach my $scm ( @scminputs ) {my $scmName = $scm->{"name"};my $nixexpr = $scm->{"nixexpr"};my $type = $scm->{"type"};my $uri = $scm->{"uri"};my $update = $scm->{"update"};my $jobset = createJobsetWithOneInput($scmName, $nixexpr, "src", $type, $uri);my $state = 0;my $q = 0;my ($loop, $updated) = updateRepository($scmName, $update);while($loop) {my $c = 0;# 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/");}}done_testing;