feat #2007: parallel isolated tests #273
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.
In this PR I'm trying to isolate the tests from each other with the smallest change possible to how they're executed to allow for:
The goal is to be able to run
dune test -w
.Implementation Notes
The interesting bits are in
test_utils.ml
and in a newsupport.ml
module wherecase
anddatabase_case
are two-sides of the same coin:Test_utils.case
wraps a regular Lwt test in a transaction, starts it and rolls it back after the test has ended.Support.database_case
does the same but ALSO executes the test.There's plenty of refactoring to do here, so don't read too much into this. Eventually those 2 functions will merge as we split out different tests groups into their own dune stanzas.
Most of the rest of the changes are just wrapping existing tests in
Test_utils.case
.Unfortunately, I'm blocked by a strange SEGFAULT issue that seems to be coming from Caqti :/ – so I'm opening the PR as a draft, and will continue this work next week.