nixvim icon indicating copy to clipboard operation
nixvim copied to clipboard

tests: replace `helpers.enableExceptInTests` with module option

Open MattSturgeon opened this issue 1 year ago • 0 comments

As discussed on matrix, the current helpers.enableExceptInTests is problematic for a couple reasons:

  • It only works with mkTestDerivationFromNixvimModule, not mkTestDerivationFromNvim
  • We need to tell helpers whether or not it'll be used for tests

This resolves those, however it has its own issues:

  • mkTestDerivationFromNvim effectively 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
  • If #1989 is merged, users can bypass the test helpers and access config.test.derivation directly anyway
  • enableExceptInTests is 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

MattSturgeon avatar Aug 20 '24 18:08 MattSturgeon