Fix #936
4Y3LBQYIG5VWPKPEP74XEGJ7KYP5AAT6OQYZP5TXQNHNHK7KP6LAC
7KLHBDYAWCWHC4ID5UM3JW2IEEMFY6QA2MXMDTRC3O3ENCPN2OJAC
2JJP76737U2JWJWQ6UDFEAQCGWRAQH46HC6OCIKWMB5QYRXF6DQQC
6HYCG3DC5RNVSH66X5DZO36OIU2IUQYH64F7QFAORALLUC3LOQDQC
X6FOUYFJ5ODEOMHLL6AHM6KI2JRZ2XOI76NYJYJNDUQBTV5UJLBAC
24BMQDZAWDQ7VNIA7TIROXSOYLOJBNZ2E4264WHWNJAEN6ZB3UOAC
73YR46NJNYZQKHA3QDJCAZYAKC2CGEF5LIS44NOIPDZU6FX6BDPQC
H7SZRHUBSEDJ3PQ3VOV4ZEEFUWTBPGZN53G6W26HHXPJDO7MSHJAC
O3NM62IZE5EMW4KY56TV53BUZZL2NHAC55W7NBPTD7A4CKT4CHUQC
UIA3ULNUQVJJJYYVSHCT3GMNYBB5GRHEMHBU2KIFPFG6YVTLMYKAC
HX4QYOYAKKFKK4KF6SZ6FQCM5ZF7ZFDTQUR4GS5WPPTYZASYZZUAC
use feature 'unicode_strings';
use strict;
use Setup;
my %ctx = test_init();
require Hydra::Schema;
require Hydra::Model::DB;
use Test2::V0;
my $db = Hydra::Model::DB->new;
hydra_setup($db);
my $project = $db->resultset('Projects')->create({name => "tests", displayname => "", owner => "root"});
my $jobset = createBaseJobset("default-machine-file", "default-machine-file.nix", $ctx{jobsdir});
ok(evalSucceeds($jobset), "Evaluating jobs/default-machine-file.nix should exit with return code 0");
is(nrQueuedBuildsForJobset($jobset), 1, "Evaluating jobs/default-machine-file.nix should result in 1 build");
for my $build (queuedBuildsForJobset($jobset)) {
ok(runBuild($build), "Build '".$build->job."' from jobs/default-machine-file.nix should exit with code 0");
my $newbuild = $db->resultset('Builds')->find($build->id);
is($newbuild->finished, 1, "Build '".$build->job."' from jobs/default-machine-file.nix should be finished.");
my $expected = $build->job eq "fails" ? 1 : $build->job =~ /with_failed/ ? 6 : 0;
is($newbuild->buildstatus, $expected, "Build '".$build->job."' from jobs/default-machine-file.nix should have buildstatus $expected.");
}
done_testing;
with import ./config.nix;
{
requireExperimentalFeatures =
mkDerivation {
name = "empty-dir";
builder = ./empty-dir-builder.sh;
requiredSystemFeatures = [ "test-system-feature" ];
};
}