aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/populate/tests/scenarios.nix
Commit message (Collapse)AuthorAgeFilesLines
* populate: tell whether a Git work tree drawn from changed by its commitHEADmastertv7 days1-0/+61
| | | | | | | | | | | | | | | | | | | Whether a derived copy of a flake or flake-input source needs to be made again depends on the sources it draws inputs from. For one that isn't in the store, the key had its hash, so every run read all of it, e.g. all of a nixpkgs work tree, .git included, which takes long even when nothing changed. For a Git work tree that Nix gets as git+file:, whose commit and tracked files are all Nix uses, the key has its commit instead, if no tracked file differs from it, which Git tells quickly. git_flake decides what Nix gets as git+file:, for resolve as well. Keys of copies drawing from such work trees change once, so those copies get made again on the first run, also after deploying with krops 1. rewrite-cache-git checks that such a copy gets made again for a new commit, but not for redeploying, nor for an untracked file.
* tests: populate's tests of its own, krops' using themtv7 days1-0/+2174
populate's tests are in pkgs/populate/tests, independent of krops. They run the program, with the sources as JSON from populate's Nix library, and target strings for the remote targets, leaving the user and whether the target is local to populate, so they cover its command line too. Phases expecting populate to refuse its arguments, e.g. a source name or a target path that can't be used, expect the program's refusal, with refused, the message, since nothing checks them during evaluation there. builder.nix is what builds the scenarios, which krops' tests use as well, with a function running the phases, and whether that checks the arguments during evaluation. vm.nix takes a module for both machines, for what else the scenarios run, and fixtures.nix and smoke.nix are what both use of the fixtures and the smoke test. krops' tests are deploy, writeDeploy's arguments to nixos-rebuild, with the stand-in for nixos-rebuild in the module, and populate, populate's scenarios that expect refusals, which pkgs.populate makes evaluation fail with, and those of populate's smoke test, all through pkgs.populate with target attribute sets as mkTarget returns them. -A only selects from all of populate's scenarios and krops' own.