-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add support for async fixtures #430
Merged
Merged
Commits on Oct 10, 2021
-
Add support for async fixtures
Previously, it was not possible to create fixtures that loaded asynchronously. It was possible to work around this limitation on the JVM by awaiting on futures, but there was no workaround for Scala.js. This commit adds support to return futures (and anything that converts to futures) from the beforeAll/beforeEach/afterEach/afterAll methods. Supersedes scalameta#418. This commit is inspired by that PR but uses a different approach: - No new `AsyncFixture[T]` type. This simplies the logic in `MUnitRunner` and reduces the size of the MUnit public API. The downside is that we introduce a breaking change to the existing `Fixture[T]` API, which will require bumping the version to v1.0.0 for the next release. - This approach supports any `Future`-like values by hooking into the default evaluation of test bodies via `munitValueTransforms`. Co-authored-by: Daniel Esik <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 69175cb - Browse repository at this point
Copy the full SHA 69175cbView commit details
Commits on Oct 11, 2021
-
A bug in Scala 2.11/2.12 made `TimeoutSuite` fail with the new async fixtures. This commit changes how we implement `munitTimeout` to race two futures instead of calling `Await.result`.
Configuration menu - View commit details
-
Copy full SHA for 995c22b - Browse repository at this point
Copy the full SHA 995c22bView commit details -
Configuration menu - View commit details
-
Copy full SHA for a9c06df - Browse repository at this point
Copy the full SHA a9c06dfView commit details -
Configuration menu - View commit details
-
Copy full SHA for cfc64be - Browse repository at this point
Copy the full SHA cfc64beView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8a123cd - Browse repository at this point
Copy the full SHA 8a123cdView commit details -
Remove infinite loop test for TimeoutSuite
This test case was causing CI failures on Linux that I wasn't able to reproduce on my local MacBook.
Configuration menu - View commit details
-
Copy full SHA for 2598fa6 - Browse repository at this point
Copy the full SHA 2598fa6View commit details -
Add infinite loop test back with a new execution context
Previously, the test suite was using a parasitic execution context.
Configuration menu - View commit details
-
Copy full SHA for 68f9e6c - Browse repository at this point
Copy the full SHA 68f9e6cView commit details
Commits on Oct 16, 2021
-
Introduce
AnyFixture
to preserveUnit
result type onFixture
Previously, the `Fixture` lifecycle methods returned `Any`, which meant that auto-completions would insert `Any` in the result type when auto-generating implementation of a fixture. Now, the `Fixture[T]` class has `Unit` as result types for consistency with older versions of MUnit. Instead, we introduce `AnyFixture[T]` which only needs to be used when comibing a list of `Fixture[T]` and `FutureFixture[T]` (along with 3rdparty fixture classes).
Configuration menu - View commit details
-
Copy full SHA for fd0ec09 - Browse repository at this point
Copy the full SHA fd0ec09View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1b3854e - Browse repository at this point
Copy the full SHA 1b3854eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e081b3 - Browse repository at this point
Copy the full SHA 9e081b3View commit details
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.