nixos/testing: Fix release.nix tests evaluation#193485
Conversation
Fixes the problem introduced by 12b3066 which caused nixos/release.nix to return the wrong attributes, while intending to only affect nixos/lib's runTest. This also removes callTest from the test options, because callTest is only ever invoked by all-tests.nix.
|
Still broken :( https://hydra.nixos.org/jobset/nixos/unstable-small#tabs-errors |
|
Different problem #193175 (comment) |
|
@roberth This breaks numerous tests such as the kenrel tests: |
Within NixOS#193485 (and the previous changes) the internal structure of the testing driver was changed. Since then, `makeTest` returns the attributes for the VM test(s) (including `driverInteractive`) inside a sub-attribute called `test`, so without this change running `nixos-build-vms` would fail like this: error: attribute 'driverInteractive' missing
|
I believe that this change, or perhaps one of the several recent related changes to testing, have broken the ability to use the NixOS Python testing framework from third-party sources when combined with For example, I rigged up this convenience function when we switched our nixpkgs overlay project to a flake. It allows you to point to a directory full of NixOS Python tests to create an attrset from them: Then, in our flake's Finally, we use another little hack I wrote so that you can run https://github.com/hackworthltd/hacknix/blob/ed730b35040f293d06dbb402f552c3b1faacdb0a/flake.nix#L406 (@roberth, I think I cribbed the Anyway, this used to work fine, but now, when it evaluates the Python test attrset, it blows up: Granted, it's not the most elegant Nix code I've ever written, but it did do the job. I'm not exactly sure why this is happening all of a sudden, but it seems to have something to do with the nested test derivations returning more attributes than they used to, or something like that? For reference this is showing up with e0ed589. The last known-good |
|
Hi @dhess, I'm sorry to have broken your code. I've tried hard to keep all the entrypoints to the test suite and test framework working, but I didn't find a satisfactory solution for |
|
Hi @robert, absolutely no need for an apology. I'm thrilled to see there's an official way to do this now. Let me see if I can get that working with |
|
Oh, forgot to mention that |
Description of changes
Fixes the problem introduced by 12b3066 which caused nixos/release.nix to return the wrong attributes, while intending to only affect nixos/lib's runTest.
This also removes callTest from the test options, because callTest is only ever invoked by all-tests.nix.
Things done
Manually tested in nix repl, covering multiple "styles" of test invocation.
release.nix, nixosTests:
pkgs.tests.testers.nixosTest-example
runTest { nodes = {}; name = "foo"; testScript = ""; hostPkgs = import ./. {}; }
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes