From 87e5304d39ddf3a0c052cc13fcfdc2b36c3dad68 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 14 Nov 2026 04:29:02 +0000 Subject: tests: pure evaluation pure-lib evaluates krops' lib from a flake whose inputs are krops' sources and nixpkgs' lib, checking that mkTarget leaves the user and the host null, and evaluating sources of each type. pure-deploy, which is exhaustive, deploys with writeDeploy from a flake whose inputs are krops' and nixpkgs' sources, evaluating nixpkgs, with a target string. The inputs are the sources in the store, without .git, copied there during the tests' evaluation, which the VM shares with the host. The flakes lock them as tarballs, by their hashes, so Nix uses the store paths, without fetching them, or reading them, which a path: input would, all of nixpkgs on every evaluation. The VM can't build what writeDeploy makes, which needs building populate, so pure-deploy runs what the host built of the same arguments, evaluated alike, failing if pure evaluation makes another derivation. nixpkgs is a flake with lib and legacyPackages, without nixpkgs' configuration and overlays, which pure evaluation can't read, and the host's evaluation could. pure-lib is in the smoke test. --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index a4b5d92..7347e24 100644 --- a/README.md +++ b/README.md @@ -355,15 +355,19 @@ automatically. `tests/` contains NixOS VM tests for krops, using the VM machinery and the scenarios of [populate's tests](pkgs/populate/README.md#tests): `deploy`, for the arguments `writeDeploy` passes to `nixos-rebuild`, which a stand-in -records, and `populate`, for `pkgs.populate`, running populate's scenarios +records, `populate`, for `pkgs.populate`, running populate's scenarios that expect populate to refuse its arguments, which `pkgs.populate` does -during evaluation, and those of populate's smoke test. The tests require +during evaluation, and those of populate's smoke test, and `pure`, for +evaluating krops' lib from a flake, and, exhaustively, deploying with +`writeDeploy` from a flake, which evaluates nixpkgs, and copies it, without +`.git`, into the store. The tests require KVM and nixpkgs with `pkgs.testers.runNixOSTest` (23.05 or later), and use `` by default. ```sh nix-build tests # all tests, except the exhaustive ones nix-build tests -A deploy # the test of writeDeploy +nix-build tests -A pure # the test of pure evaluation nix-build tests -A exhaustive # all exhaustive tests nix-build tests -A smoke # a few scenarios of each, in one VM nix-build tests -A only --argstr only 'lock-hooks-.*' # scenarios by name -- cgit v1.3.1