aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/populate/tests
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-12-01 03:52:13 +0000
committertv <tv@krebsco.de>2026-12-01 03:52:13 +0000
commit9cbe2fab9a3fe30ce4218458112ab46e49c6ac7c (patch)
treedeba59a2f8d09787d27aa92dccd5bd023bb98453 /pkgs/populate/tests
parent75df988e1cb9863ee5d708dbc578f7690bb182de (diff)
populate pipe: a fixed time rsync can keep
What pipe sources make gets a fixed modification time, so only checksums tell whether it changed. That time was in the year 3000, beyond what rsync can keep: it stored it as 2446-05-10, so source and target differed on every run, rsync set the time again, and the run record said the source changed. 2000-01-01, in UTC whatever the deploying machine's time zone, rsync keeps. The pipe scenarios check that a run with the same output changes nothing.
Diffstat (limited to 'pkgs/populate/tests')
-rw-r--r--pkgs/populate/tests/scenarios.nix28
1 files changed, 21 insertions, 7 deletions
diff --git a/pkgs/populate/tests/scenarios.nix b/pkgs/populate/tests/scenarios.nix
index dac8e6b..0f1051c 100644
--- a/pkgs/populate/tests/scenarios.nix
+++ b/pkgs/populate/tests/scenarios.nix
@@ -461,13 +461,21 @@ in
};
});
- pipe = matrix "pipe" {} (_: _: {
- phases = twice {
- sources.x.pipe = "/fixtures/pipe";
- check = ''
- expect_eq x "$(cat "$T"/x)" piped
- '';
- };
+ pipe = matrix "pipe" {} (_: _: let
+ check = ''
+ expect_eq x "$(cat "$T"/x)" piped
+ '';
+ in {
+ phases = [
+ { sources.x.pipe = "/fixtures/pipe"; inherit check; }
+ # The same output again changes nothing, its time neither.
+ {
+ sources.x.pipe = "/fixtures/pipe";
+ check = check + ''
+ expect_eq changed "$(record changed)" false
+ '';
+ }
+ ];
})
# A directory the command makes: delivered with the modes it has, and
# mirrored, when what the command makes changes.
@@ -500,6 +508,12 @@ in
test ! -e "$T"/x/stray || fail "stray not removed"
'';
}
+ {
+ inherit sources;
+ check = secret "two" + ''
+ expect_eq changed "$(record changed)" false
+ '';
+ }
];
})) targetKinds;
[cgit] Unable to lock slot /tmp/cgit/59300000.lock: Permission denied (13)