Skip to content

Commit

Permalink
Beef of content addressing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericson2314 committed Dec 11, 2023
1 parent 17c8d51 commit 7d7a2a3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion t/content-addressed/basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ my $project = $db->resultset('Projects')->create({name => "tests", displayname =
my $jobset = createBaseJobset("content-addressed", "content-addressed.nix", $ctx{jobsdir});

ok(evalSucceeds($jobset), "Evaluating jobs/content-addressed.nix should exit with return code 0");
is(nrQueuedBuildsForJobset($jobset), 4, "Evaluating jobs/content-addressed.nix should result in 4 builds");
is(nrQueuedBuildsForJobset($jobset), 5, "Evaluating jobs/content-addressed.nix should result in 4 builds");

for my $build (queuedBuildsForJobset($jobset)) {
ok(runBuild($build), "Build '".$build->job."' from jobs/content-addressed.nix should exit with code 0");
Expand Down
9 changes: 8 additions & 1 deletion t/jobs/content-addressed.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,17 @@ rec {
builder = ./succeed-with-failed.sh;
};

caDependingOnCA =
cfg.mkContentAddressedDerivation {
name = "ca-depending-on-ca";
builder = ./dir-with-file-builder.sh;
FOO = empty_dir;
};

nonCaDependingOnCA =
cfg.mkDerivation {
name = "non-ca-depending-on-ca";
builder = ./empty-dir-builder.sh;
builder = ./dir-with-file-builder.sh;
FOO = empty_dir;
};
}
Expand Down
7 changes: 7 additions & 0 deletions t/jobs/dir-with-file-builder.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#! /bin/sh

# Workaround for https://github.com/NixOS/nix/pull/6051
echo "some output"

mkdir $out
echo foo > $out/a-file

0 comments on commit 7d7a2a3

Please sign in to comment.