tests: support overriding disko config #480
Draft
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.
The goal of this PR is to add an interface for end users to be able to override the disko config for disko-based tests like
system.build.installTest
.I modified some examples to intentionally fail so that we can add test-specific overrides in the same file to show end users examples of overriding the disko config just for tests.
I chose to not make
makeDiskoTest
aware ofdisko-config.disko.tests.extraDiskoConfig
to simplify the merging logic, however that means callers ofmakeDiskoTest
need to setextraDiskoConfig
fromdisko.tests.extraDiskoConfig
if they're using standalone files like the tests inside this repo.I'm not really sure if this PR is the right way to implement this as currently it feels like
makeDiskoTest
is just a poor man's module system:disko/lib/tests.nix
Lines 44 to 80 in 9ab9637
and as I'm merging values manually, it makes it feel like that even more:
disko/lib/tests.nix
Line 79 in 6b98b81