nixvim
nixvim copied to clipboard
tests: replace `helpers.enableExceptInTests` with module option
As discussed on matrix, the current helpers.enableExceptInTests is problematic for a couple reasons:
- It only works with
mkTestDerivationFromNixvimModule, notmkTestDerivationFromNvim - We need to tell
helperswhether or not it'll be used for tests
This resolves those, however it has its own issues:
mkTestDerivationFromNvimeffectively evaluates the modules twice (once before being called, then again internally)- I guess this is no different from evaluating a standalone build in one place and then again separately using
mkTestDerivationFromNixvimModule
- I guess this is no different from evaluating a standalone build in one place and then again separately using
- If #1989 is merged, users can bypass the test helpers and access
config.test.derivationdirectly anyway enableExceptInTestsis removed immediately, with no grace period for the deprecation
I wonder if it'd be better to not provide any direct support for distinguishing between test/non-test contexts?
Or perhaps we should double down on the evalNixvimTest function proposed in #1989's description and use that to set the context?
See #1095