tests/input-types: split out scminputs into individual tests
This makes the test faster (by removing it and replacing it with a `TestScmInput` module that exports the `testScmInput` subroutine). Now, all the input tests can be run in parallel. Some of the `tests/jobs/*-update.sh` scripts were "broken" (e.g. tests failed for various reasons on my machine), so I fixed those up as well. Co-authored-by: gustavderdrache <gustavderdrache@gmail.com>
This commit is contained in:
28
tests/input-types/bzr-checkout.t
Normal file
28
tests/input-types/bzr-checkout.t
Normal file
@ -0,0 +1,28 @@
|
||||
use strict;
|
||||
use Cwd;
|
||||
use Setup;
|
||||
use TestScmInput;
|
||||
|
||||
(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);
|
||||
|
||||
# Tests the creation of a Hydra jobset using a bzr checkout as input.
|
||||
testScmInput(
|
||||
type => 'bzr-checkout',
|
||||
expr => 'bzr-checkout-input.nix',
|
||||
uri => 'bzr-checkout-repo',
|
||||
update => 'jobs/bzr-checkout-update.sh',
|
||||
|
||||
# directories
|
||||
datadir => $datadir,
|
||||
testdir => getcwd,
|
||||
);
|
||||
|
||||
done_testing;
|
28
tests/input-types/bzr.t
Normal file
28
tests/input-types/bzr.t
Normal file
@ -0,0 +1,28 @@
|
||||
use strict;
|
||||
use Cwd;
|
||||
use Setup;
|
||||
use TestScmInput;
|
||||
|
||||
(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);
|
||||
|
||||
# Tests the creation of a Hydra jobset using a bzr repo as input.
|
||||
testScmInput(
|
||||
type => 'bzr',
|
||||
expr => 'bzr-input.nix',
|
||||
uri => 'bzr-repo',
|
||||
update => 'jobs/bzr-update.sh',
|
||||
|
||||
# directories
|
||||
datadir => $datadir,
|
||||
testdir => getcwd,
|
||||
);
|
||||
|
||||
done_testing;
|
28
tests/input-types/darcs.t
Normal file
28
tests/input-types/darcs.t
Normal file
@ -0,0 +1,28 @@
|
||||
use strict;
|
||||
use Cwd;
|
||||
use Setup;
|
||||
use TestScmInput;
|
||||
|
||||
(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);
|
||||
|
||||
# Tests the creation of a Hydra jobset using a darcs repo as input.
|
||||
testScmInput(
|
||||
type => 'darcs',
|
||||
expr => 'darcs-input.nix',
|
||||
uri => 'darcs-repo',
|
||||
update => 'jobs/darcs-update.sh',
|
||||
|
||||
# directories
|
||||
datadir => $datadir,
|
||||
testdir => getcwd,
|
||||
);
|
||||
|
||||
done_testing;
|
29
tests/input-types/deepgit.t
Normal file
29
tests/input-types/deepgit.t
Normal file
@ -0,0 +1,29 @@
|
||||
use strict;
|
||||
use Cwd;
|
||||
use Setup;
|
||||
use TestScmInput;
|
||||
|
||||
(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);
|
||||
|
||||
# Tests the creation of a Hydra jobset using a deep git clone as input.
|
||||
testScmInput(
|
||||
type => 'git',
|
||||
name => 'deepgit',
|
||||
expr => 'deepgit-input.nix',
|
||||
uri => 'git-repo master 1',
|
||||
update => 'jobs/git-update.sh',
|
||||
|
||||
# directories
|
||||
datadir => $datadir,
|
||||
testdir => getcwd,
|
||||
);
|
||||
|
||||
done_testing;
|
29
tests/input-types/git-rev.t
Normal file
29
tests/input-types/git-rev.t
Normal file
@ -0,0 +1,29 @@
|
||||
use strict;
|
||||
use Cwd;
|
||||
use Setup;
|
||||
use TestScmInput;
|
||||
|
||||
(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);
|
||||
|
||||
# Tests the creation of a Hydra jobset using a git revision as input.
|
||||
testScmInput(
|
||||
type => 'git',
|
||||
name => 'git-rev',
|
||||
expr => 'git-rev-input.nix',
|
||||
uri => 'git-repo 7f60df502b96fd54bbfa64dd94b56d936a407701',
|
||||
update => 'jobs/git-rev-update.sh',
|
||||
|
||||
# directories
|
||||
datadir => $datadir,
|
||||
testdir => getcwd,
|
||||
);
|
||||
|
||||
done_testing;
|
28
tests/input-types/git.t
Normal file
28
tests/input-types/git.t
Normal file
@ -0,0 +1,28 @@
|
||||
use strict;
|
||||
use Cwd;
|
||||
use Setup;
|
||||
use TestScmInput;
|
||||
|
||||
(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);
|
||||
|
||||
# Tests the creation of a Hydra jobset using a git repo as input.
|
||||
testScmInput(
|
||||
type => 'git',
|
||||
expr => 'git-input.nix',
|
||||
uri => 'git-repo',
|
||||
update => 'jobs/git-update.sh',
|
||||
|
||||
# directories
|
||||
datadir => $datadir,
|
||||
testdir => getcwd,
|
||||
);
|
||||
|
||||
done_testing;
|
28
tests/input-types/hg.t
Normal file
28
tests/input-types/hg.t
Normal file
@ -0,0 +1,28 @@
|
||||
use strict;
|
||||
use Cwd;
|
||||
use Setup;
|
||||
use TestScmInput;
|
||||
|
||||
(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);
|
||||
|
||||
# Tests the creation of a Hydra jobset using a hg repo as input.
|
||||
testScmInput(
|
||||
type => 'hg',
|
||||
expr => 'hg-input.nix',
|
||||
uri => 'hg-repo',
|
||||
update => 'jobs/hg-update.sh',
|
||||
|
||||
# directories
|
||||
datadir => $datadir,
|
||||
testdir => getcwd,
|
||||
);
|
||||
|
||||
done_testing;
|
28
tests/input-types/svn-checkout.t
Normal file
28
tests/input-types/svn-checkout.t
Normal file
@ -0,0 +1,28 @@
|
||||
use strict;
|
||||
use Cwd;
|
||||
use Setup;
|
||||
use TestScmInput;
|
||||
|
||||
(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);
|
||||
|
||||
# Tests the creation of a Hydra jobset using a svn checkout as input.
|
||||
testScmInput(
|
||||
type => 'svn-checkout',
|
||||
expr => 'svn-checkout-input.nix',
|
||||
uri => 'svn-checkout-repo',
|
||||
update => 'jobs/svn-checkout-update.sh',
|
||||
|
||||
# directories
|
||||
datadir => $datadir,
|
||||
testdir => getcwd,
|
||||
);
|
||||
|
||||
done_testing;
|
28
tests/input-types/svn.t
Normal file
28
tests/input-types/svn.t
Normal file
@ -0,0 +1,28 @@
|
||||
use strict;
|
||||
use Cwd;
|
||||
use Setup;
|
||||
use TestScmInput;
|
||||
|
||||
(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);
|
||||
|
||||
# Tests the creation of a Hydra jobset using a svn repo as input.
|
||||
testScmInput(
|
||||
type => 'svn',
|
||||
expr => 'svn-input.nix',
|
||||
uri => 'svn-repo',
|
||||
update => 'jobs/svn-update.sh',
|
||||
|
||||
# directories
|
||||
datadir => $datadir,
|
||||
testdir => getcwd,
|
||||
);
|
||||
|
||||
done_testing;
|
Reference in New Issue
Block a user