-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixosTest matrix (prev also modularity, option docs) #176557
base: master
Are you sure you want to change the base?
Conversation
nixos/lib/testing/matrix.nix
Outdated
|
||
you test in wonderland, and I show you how deep the rabbit hole goes... | ||
|
||
Remember, all I'm offering is the multiverse... Follow me... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just ❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all fun, but should rather go to your personal blog post or whatever material targeted to a select audience. Literally everyone outside the western cultural circle in their mid-30s will be completely thrown off. And possibly pissed to have to filter out what matters if they just want to get their job done.
Please, please, please, do not use cultural homages and idioms in open source software! They only entrench all the social biases we already have in the community.
(I'd love to see it kept in the Git history though, because it is funny if you understand it!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. I already felt it was on the edge of acceptable, but you're absolutely right about the biases. Thank you for reminding me!
In a way it was also "hiding" the fact that that part of the documentation was rather incomplete.
I haven't rebased it away, so you'll still be able to find it. (Remove movie references
; hash might change)
8db9224
to
042ef42
Compare
042ef42
to
ed70555
Compare
Tried to make it work in NixOS#177080 but that still didn't solve all cases in practice (wip NixOS#176557). Found a simpler solution: don't number anonymous modules at all. Keys are assigned at a later stage anyway. We don't have to reinvent that solution in submoduleWith.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
9af92a6
to
15281ff
Compare
548cdc7
to
5e41764
Compare
Thanks to fricklerhandwerk for the many suggestions, most of which I have fixupped into preceding commits.
Except for one easter egg decorating an error message that should be easy to resolve.
It makes more sense to let the modules guide the invocation of this function rather than to produce a data structure and then consume it immmediately. Maybe the same should be done for exposeIntermediateAttrs. It'd turn the two functions into a catamorphism that's integrated into the modules.
7f192f2
to
1b39fb2
Compare
@Atemu just rebased. Annoying but wasn't all that bad. Personally I can't spend a lot of time on this, but it seems that the PR is in a decent state now. TODO: hacking
TODO: review
TODO: final double-check; manual testing
|
I think we should do our best to get an MVP of this PR without major regressions in first. Any further niceties and minor refactorings can come later. It's important further changes to tests can make use of this PR's core changes ASAP so that we don't diverge endlessly. Would a hydra jobset to verify help? |
Just need to do a bit of due diligence, but yeah, no need to drag this out.
There's a jobset any nixpkgs maintainer can reuse: https://hydra.nixos.org/jobset/nixos/python-test-refactoring. I'll document how to use it effectively. |
Documenting the testing process here #216660 |
I have to be honest: I don't think I'll get around to completing this. It'd be great if someone could take over. Also: don't use the existence of this as an excuse not to write parameterized nixos tests. The true cost of writing a test is in finding the requirements and doing implementation work. Changing an already parameterized test to use a framework like this is tiny. |
This needs modularization. In the current code, it adds a hook to override the return value. This isn't terrible, but obscures the fact that conceptually the test matrix comes before the test, even if both things can be specified in the same module. It also makes it impossible to use the test matrix logic in a context other than the NixOS test framework, or in a combined way. TODO:
EDIT: Also move it to |
Is it true that without merging this PR currently My attempts have failed.If I import `nixos/tests/some-test.nix`, the resulting set is not suitable for reuse in `runTest`. NixOS tests import `make-test-python.nix` right on the first line, that doesn't allow to access the original `nodes` attribute set. |
Description of changes
Use the module system to replace the NixOS test framework's custom glue.
imports
and other module system features.common module that has most of the setup.
testing/interactive.nix
: just a couple of lines that can be ignored by the other modules, as opposed to wiring it through what is nowtesting/run.nix
.testing/network.nix
, etcAll in all, this quite significantly collapses the number of layers and custom expressions that test authors have to deal with.
Also, more info in the expanded commit messages.
TODO:
attrArgName
#177576defaults
optioneither move to "legacy" directory and leave in place until all migrated?or big bang and monitor the falloutnixos-test-staging
jobset in hydraname
inspecialArgs
; feasible with somenetwork.nix
refactoring to make the nodeconfig
skeleton static.done:
-
_3proxy
-
acme
-
adguardhome
-
aesmd
-
agate
-
avahi
-
cassandra
-
oci-containers
-
hostname
-
networking
avahi
oci-containers
networking
:implementation
andtestcase
axes)matrix.<choice>.enable = false
+matrix.<choice>.after
)cassandra.passthru.tests.nixos
)matrix
(asvalue.<value>
is a "parallel universe" of the entire test config) ->avahi
matrix
: renamevalue
tomodule
?Closes #144110
Things done
sandbox = true
set 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.sh
to update generated release notes