tests/nixpkgs: move nixpkgs module test to dedicated drv #2740
+116
−74
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We don't need a full test that actually builds or runs nixvim. All we need is some assertions on the result of a nixvim configuration.
Currently #2738 needs to change the module tests to construct their own
pkgs
instance, so that we can test how the module behaves. However this is likely to have a performance hit since we are repeatedly instanciatingpkgs
again for each test case. It's probably better to use a singlepkgs
instance for all test case modules, but move the nixpkgs-module tests to their own dedicated test derivation.This PR does that, moving the existing tests to a dedicated link-farm.
This also allows creating some bespoke helpers to streamline writing the tests and may improve performance slightly because we don't need to also build
config.build.package
for the nixpkgs-module unit tests.The bespoke helpers are a little cumbersome, so I'm open to feedback on them. Some of them may also be useful more generally, so may be worth moving to some kinda "test utils" file. This can be done now or later.