-
-
Notifications
You must be signed in to change notification settings - Fork 157
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
Explicitly list testTargets #617
base: master
Are you sure you want to change the base?
Conversation
7e57521
to
c44a20e
Compare
`testTarget` is a space separated list of test-suites. We explicitly list all test suites. This allows us to implement logic in the nixpkgs builder to run test suites in separate passthru.test derivations.
c44a20e
to
58341dd
Compare
If we're going to do this, I'd add W.r.t. this change, I'm not sure if this is the best course of action yet. It seems good in principle, however it is going to massively increase the size of Skipping tests could in principle be implemented in the builder without having data about the names of all test suites at eval time, so I'm curious about the second use case you mention. Can you maybe share the code for a proof of concept for that? |
I share the concern that hard coding the list of tests makes the derivations bigger and less flexible. (e.g. sometimes it is useful to use the same derivation with a different source, the more specific we make the derivation the less flexible it will be.) Maybe we can introduce a list of disabled tests in the builder where we query cabal for the list of available tests and filter out disabled ones at build time and not at eval time? |
Thanks for taking a look folks!
Cool I might make an MR to do this refactoring.
This is a very good point! The disabled test stuff is just a nice extra. My main aim with this is to enable passthru.tests style test suites. Take a look at NixOS/nixpkgs#305958. I think that, in its current form, this requires us to have the list of test suites at eval time. That's because it creates a I think there's two ways to proceed:
I think we could also mix (1) and (2), where if What do you all think? |
testTarget
is a space separated list of test-suites.We explicitly list all test suites.
This allows us to implement logic in the nixpkgs builder to run test suites in separate passthru.test derivations. See: NixOS/nixpkgs#305958
Additionally it makes it easier to filter out test suites we don't want.
I've chosen to avoid changing the type of
testTarget
from aString
to a[String]
in order to avoid a breaking change. I think this would be a good change to make but I'm not sure how it would work in practice? Maybe we could add a newtestTargets
field in the generic builder and use that to transition?