From dd166e5a4d4349241aa3408c8d7f7340cb0a90fb Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 14 Nov 2026 00:33:20 +0000 Subject: tests: populate's tests of its own, krops' using them 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. --- pkgs/populate/tests/fixtures.nix | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 pkgs/populate/tests/fixtures.nix (limited to 'pkgs/populate/tests/fixtures.nix') diff --git a/pkgs/populate/tests/fixtures.nix b/pkgs/populate/tests/fixtures.nix new file mode 100644 index 0000000..c834898 --- /dev/null +++ b/pkgs/populate/tests/fixtures.nix @@ -0,0 +1,7 @@ +# What tests know about the fixtures fixtures.sh creates: HEAD of +# /fixtures/gitsrc, which fixtures.sh creates deterministically, and its +# parent. fixtures.sh fails if HEAD differs, naming the actual one. +{ + gitHead = "e42d44ef9cdb76ba5a84dff4c89c38222703bf0c"; + gitFirst = "8d47013fa0888948cf0ffcc4e3c69a7b5f180562"; +} -- cgit v1.3.1