diff --git a/t/Controller/Jobset/channel.t b/t/Controller/Jobset/channel.t index 2b034025..c632cf55 100644 --- a/t/Controller/Jobset/channel.t +++ b/t/Controller/Jobset/channel.t @@ -5,7 +5,9 @@ use IO::Uncompress::Bunzip2 qw(bunzip2); use Archive::Tar; use JSON qw(decode_json); use Data::Dumper; -my %ctx = test_init(); +my %ctx = test_init( + use_external_destination_store => 0 +); require Hydra::Schema; require Hydra::Model::DB; diff --git a/t/lib/Setup.pm b/t/lib/Setup.pm index b5236978..151e3d61 100644 --- a/t/lib/Setup.pm +++ b/t/lib/Setup.pm @@ -20,6 +20,9 @@ our @EXPORT = qw(test_init hydra_setup nrBuildsForJobset queuedBuildsForJobset # # * hydra_config: configuration for the Hydra processes for your test. # * 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 # values: a temporary database, temporary Nix store, temporary Hydra @@ -54,6 +57,9 @@ sub test_init { $ENV{'HYDRA_CONFIG'} = "$dir/hydra.conf"; 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'} || ""; close $fh;