Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat #2007: parallel isolated tests #273

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

leostera
Copy link
Collaborator

@leostera leostera commented Dec 1, 2023

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:

  1. parallel test execution
  2. better test caching with dune
  3. better test quality by avoiding leaked state across tests
  4. fix data-dependencies across tests that we have today (some FIXMEs in newer integration tests)

The goal is to be able to run dune test -w.

Implementation Notes

The interesting bits are in test_utils.ml and in a new support.ml module where case and database_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.

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.

None yet

1 participant