forked from lix-project/hydra
Merge pull request #940 from regnat/test-with-remote-dest-store
Run the tests with a remote dest store
This commit is contained in:
commit
29028258e3
|
@ -5,7 +5,9 @@ use IO::Uncompress::Bunzip2 qw(bunzip2);
|
||||||
use Archive::Tar;
|
use Archive::Tar;
|
||||||
use JSON qw(decode_json);
|
use JSON qw(decode_json);
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
my %ctx = test_init();
|
my %ctx = test_init(
|
||||||
|
use_external_destination_store => 0
|
||||||
|
);
|
||||||
|
|
||||||
require Hydra::Schema;
|
require Hydra::Schema;
|
||||||
require Hydra::Model::DB;
|
require Hydra::Model::DB;
|
||||||
|
|
|
@ -20,6 +20,9 @@ our @EXPORT = qw(test_init hydra_setup nrBuildsForJobset queuedBuildsForJobset
|
||||||
#
|
#
|
||||||
# * hydra_config: configuration for the Hydra processes for your test.
|
# * hydra_config: configuration for the Hydra processes for your test.
|
||||||
# * nix_config: text to include in the test's nix.conf
|
# * nix_config: text to include in the test's nix.conf
|
||||||
|
# * use_external_destination_store: Boolean indicating whether hydra should
|
||||||
|
# use a destination store different from the evaluation store.
|
||||||
|
# True by default.
|
||||||
#
|
#
|
||||||
# This clears several environment variables and sets them to ephemeral
|
# This clears several environment variables and sets them to ephemeral
|
||||||
# values: a temporary database, temporary Nix store, temporary Hydra
|
# values: a temporary database, temporary Nix store, temporary Hydra
|
||||||
|
@ -54,6 +57,9 @@ sub test_init {
|
||||||
$ENV{'HYDRA_CONFIG'} = "$dir/hydra.conf";
|
$ENV{'HYDRA_CONFIG'} = "$dir/hydra.conf";
|
||||||
|
|
||||||
open(my $fh, '>', $ENV{'HYDRA_CONFIG'}) or die "Could not open file '" . $ENV{'HYDRA_CONFIG'}. " $!";
|
open(my $fh, '>', $ENV{'HYDRA_CONFIG'}) or die "Could not open file '" . $ENV{'HYDRA_CONFIG'}. " $!";
|
||||||
|
if ($opts{'use_external_destination_store'} // 1) {
|
||||||
|
print $fh "store_uri = file:$dir/nix/dest-store\n"
|
||||||
|
}
|
||||||
print $fh $opts{'hydra_config'} || "";
|
print $fh $opts{'hydra_config'} || "";
|
||||||
close $fh;
|
close $fh;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue