From e45f852277ad8bbdf15cac2f8ddecd8a788b2e40 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Wed, 14 Apr 2021 14:10:43 -0400 Subject: [PATCH] tests: allow specifying some nix config --- t/lib/Setup.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/t/lib/Setup.pm b/t/lib/Setup.pm index 14655348..b5236978 100644 --- a/t/lib/Setup.pm +++ b/t/lib/Setup.pm @@ -19,6 +19,7 @@ our @EXPORT = qw(test_init hydra_setup nrBuildsForJobset queuedBuildsForJobset # Hash Parameters: # # * hydra_config: configuration for the Hydra processes for your test. +# * nix_config: text to include in the test's nix.conf # # This clears several environment variables and sets them to ephemeral # values: a temporary database, temporary Nix store, temporary Hydra @@ -47,6 +48,7 @@ sub test_init { my $nixconf = "$ENV{'NIX_CONF_DIR'}/nix.conf"; open(my $fh, '>', $nixconf) or die "Could not open file '$nixconf' $!"; print $fh "sandbox = false\n"; + print $fh $opts{'nix_config'} || ""; close $fh; $ENV{'HYDRA_CONFIG'} = "$dir/hydra.conf";