Add test to verify includes work
[?]
Jul 26, 2021, 5:13 PM
HXEZUCTD7T3YUT3XKWQOWRFSADNFZT2EYXHOATIBXWTNACDHNQQQCDependencies
- [2]
4QI6G7YBtests: replace the flat list of contexts with a hash - [3]
5DXGOH6Qstatsd: add a chance to set hostname and port in hydra.conf - [4]
DNOLOMX7hydra-send-stats: add a failing test asserting it can run - [5]
4Y3LBQYIUse system-features from the Nix conf in the default machine file - [6]
2I3HFWBKtests: Make the external destination store optional - [7]
HUCBINMQOnly add the Nix system feature to the test that requires it - [8]
4WLW4VHSTest setup: support arbitrary hydra config - [9]
OWRS526HCreate an ephemeral PostgreSQL database per test - [10]
UIA3ULNUGive each test its own Nix directories - [11]
FAIJDQKZ - [12]
3AKZKWCRRunCommand: Test - [13]
6HYCG3DCtests: allow specifying some nix config - [14]
C66VQYWTRun the tests with a remote dest store - [15]
YIZWKGFItests: add jobsdir and testdir to ctx hash - [16]
U2PHPVGDt/Setup.pm: sort NIX_ env vars - [17]
HX4QYOYAadd first evaluations tests - [18]
HE3GX5IPOptimize fetch-git.
Change contents
- file addition: include.t[3.986]
use strict;use Setup;my %ctx = test_init(use_external_destination_store => 0,hydra_config => "include foo.conf");write_file($ctx{'tmpdir'} . "/foo.conf", q|<foo>include bar.conf</foo>|);write_file($ctx{'tmpdir'} . "/bar.conf", q|bar = baz|);require Hydra::Helper::Nix;use Test2::V0;is(Hydra::Helper::Nix::getHydraConfig(), {foo => { bar => "baz" }}, "Nested includes work.");done_testing; - replacement in t/lib/Setup.pm at line 12
our @EXPORT = qw(test_init hydra_setup nrBuildsForJobset queuedBuildsForJobsetour @EXPORT = qw(test_init hydra_setup write_file nrBuildsForJobset queuedBuildsForJobset - replacement in t/lib/Setup.pm at line 52[7.1767]→[7.1767:1878](∅→∅),[5.1718]→[7.57:98](∅→∅),[7.1878]→[7.57:98](∅→∅),[7.98]→[7.1878:1893](∅→∅),[7.1878]→[7.1878:1893](∅→∅),[7.1893]→[7.872:873](∅→∅)
open(my $fh, '>', $nixconf) or die "Could not open file '$nixconf' $!";print $fh "sandbox = false\n";print $fh $opts{'nix_config'} || "";close $fh;my $nix_config = "sandbox = false\n" . $opts{'nix_config'};write_file($nixconf, $nix_config); - replacement in t/lib/Setup.pm at line 56
open(my $fh, '>', $ENV{'HYDRA_CONFIG'}) or die "Could not open file '" . $ENV{'HYDRA_CONFIG'}. " $!";my $hydra_config = $opts{'hydra_config'} || ""; - replacement in t/lib/Setup.pm at line 58
print $fh "store_uri = file:$dir/nix/dest-store\n"$hydra_config = "store_uri = file:$dir/nix/dest-store\n" . $hydra_config; - replacement in t/lib/Setup.pm at line 60
print $fh $opts{'hydra_config'} || "";close $fh;write_file($ENV{'HYDRA_CONFIG'}, $hydra_config); - edit in t/lib/Setup.pm at line 80
}sub write_file {my ($path, $text) = @_;open(my $fh, '>', $path) or die "Could not open file '$path' $!";print $fh $text || "";close $fh;