Skip to content

Conversation

@MattSturgeon
Copy link
Member

@MattSturgeon MattSturgeon commented Nov 19, 2025

  • modules/test: fix passthru example
  • lib: move enableExceptInTests impl to build.test option

Motivated by #3951 and similar instances of enableExceptInTests not working well with our less-abstracted APIs.

Simplify the enableExceptInTests attribute, removing the _nixvimTests argument.

We now do a full re-eval of the nixvim configuration before building the test, giving us a central place to implement enableExceptInTests and its eventual replacement(s).

This extends support for enableExceptInTests to all methods of getting a nixvim test derivation. Previously, it only worked when using mkTestDerivationFromNixvimModule and it only worked for helpers, not lib.nixvim.

I'm a bit concerned about the re-eval increasing out buildbot load. But I can't see an alternative way to achieve a "we are in test mode now" without things getting messy.

Maybe we could have it so that the build.test option only uses extendModules when not already in "test mode"? That way our test suite could explicitly set test mode on the initial eval, with no re-eval needed...

@MattSturgeon
Copy link
Member Author

Maybe we could have it so that the build.test option only uses extendModules when not already in "test mode"? That way our test suite could explicitly set test mode on the initial eval, with no re-eval needed...

Done

Simplify the `enableExceptInTests` attribute, removing the
`_nixvimTests` argument.

We now do a full re-eval of the nixvim configuration before building the
test, giving us a central place to implement `enableExceptInTests` and
its eventual replacement(s).

This extends support for `enableExceptInTests` to all methods of getting
a nixvim test derivation. Previously, it only worked when using `mkTestDerivationFromNixvimModule`.

In `tests/main.nix`, we avoid the re-eval by doing the initial eval with
a "test mode" lib from the start.
Copy link
Member

@GaetanLepage GaetanLepage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Such performance + cleaning PRs are always welcome :)

@MattSturgeon MattSturgeon added this pull request to the merge queue Nov 20, 2025
Merged via the queue into nix-community:main with commit 8d0ca9a Nov 20, 2025
4 checks passed
@MattSturgeon MattSturgeon deleted the tests-module-cleanup branch November 20, 2025 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants