-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
testVersion: automatically detect package #190577
Comments
The purpose of I can imagine a module-system-like module that can express your intent even more concisely, but for now we don't have such a feature in |
Thanks for the response.
When thinking naively without knowing anything about Nix internals, i think Nix can be able to know for which package a test is when you run them with The architecture should enable us to write readable, elegant and short code and not limit us in that goal. |
I agree with the ambition that it should be simple to specify a test, but by removing the need for This is why I brought up module style composition, as a different kind of interface that better supports the kind of logic you want.
Decent goals that need to be balanced by the same goals at the other side of the interface. |
Issue description
Currently the
package
name has to be set manually every time.It would be great if
testVersion
can detect it somehow, so you don't have to repeat it (DRY).Then a minimal config. looks like this:
There are some packages in nixpkgs that use some form where they don't have to write the package name, but my naive approach to just copy it to
testVersion
s code does not work.nixpkgs/pkgs/development/tools/amazon-qldb-shell/default.nix
Line 33 in 350fd00
nixpkgs/pkgs/applications/misc/swaynotificationcenter/default.nix
Lines 75 to 78 in d14d17e
As described in https://nixos.org/manual/nixpkgs/stable/#var-meta-tests.
nixpkgs/pkgs/development/compilers/go-jsonnet/default.nix
Lines 20 to 23 in 350fd00
cc @raboof @roberth @0x4A6F @Artturin
Is there any chance this is possible with Nix?
The text was updated successfully, but these errors were encountered: