diff options
| author | tv <tv@krebsco.de> | 2026-11-12 02:34:16 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-12 02:34:16 +0000 |
| commit | af300230cf4a70a5681aadf7a8ed35add1b58962 (patch) | |
| tree | 0cca5feae9f7691c9a32bb7bdce76e961e73a1af /tests/scenarios.nix | |
| parent | d1fe05cba1747f24fa16a51348fd0387f54897e6 (diff) | |
tests: check re-locking of generated flakes and git+file: references
Deploying the same sources twice doesn't show whether generated flakes get
locked again, and the git scenarios' results are the same whether a Git
work tree is referred to as git+file: or path:. A feature scenario
changes what a source contains between two deploys, and the git
scenarios check the reference.
Diffstat (limited to 'tests/scenarios.nix')
| -rw-r--r-- | tests/scenarios.nix | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/scenarios.nix b/tests/scenarios.nix index eb6bbec..e56cb13 100644 --- a/tests/scenarios.nix +++ b/tests/scenarios.nix @@ -358,6 +358,8 @@ assert !(krops.isLocalTarget (targets.remote "/")); } test -e "$T"/x/two || fail "two missing" '' + optionalString flags.inputs '' + grep -q '"git+file:' "$T"/.populate/flakes/x/flake.nix || + fail "the Git work tree isn't referred to as git+file:" gc expect_eq msg "$(nix_eval "$T"/.populate/flakes/x#msg)" git:alt ''; @@ -559,6 +561,26 @@ assert !(krops.isLocalTarget (targets.remote "/")); ''; }; }) + # A generated flake gets locked again when a source it draws from + # changes. + (s "relock" (let + x.file = { path = "/fixtures/filesrc"; inputs.dep.follows = "a"; }; + in { + phases = [ + { + sources = { inherit x; a.file = "/fixtures/alt"; }; + check = '' + expect_eq msg "$(nix_eval_online "$T"/.populate/flakes/x#msg)" top:alt,sub + ''; + } + { + sources = { inherit x; a.file = "/fixtures/alt2"; }; + check = '' + expect_eq msg "$(nix_eval_online "$T"/.populate/flakes/x#msg)" top:alt2,sub + ''; + } + ]; + })) # A generated flake gets removed once its source draws no inputs anymore. (s "removal" { phases = [ |
