{{ message }}
Repository navigation
Fix parameterized setup to run once after initialization - #1190
Open
hugoncosta wants to merge 2 commits into
Open
hugoncosta wants to merge 2 commits into
hugoncosta wants to merge 2 commits into
Conversation
Remove declared Before and BeforeEach lifecycle annotations when setup moves into parameter initialization. Invoke each setup method once after constructor or field parameters are assigned, and cover the double invocation regression.
20 of 76 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

What's changed?
Fix
ParameterizedRunnerToParameterizedso declared setup methods run exactly once, after constructor or field parameters are assigned.@Beforeand Jupiter@BeforeEach.setupRunsOnceAfterParameterAssignment, which checks the assigned value and setup count, and correct the existing expected output.What's your motivation?
Extract the Java setup correction from #1189 into a focused review, following the request to split the Kotlin migration contribution into smaller PRs.
Keeping a Jupiter lifecycle annotation while also calling setup from parameter initialization can invoke setup twice and run it before injected fields are assigned.
Verification
ParameterizedRunnerToParameterizedTestcases pass on this branch.main.git diff --checkpasses.Local verification used public build plugin 2.23.0 / Rewrite 8.90.4 through an uncommitted build override. The repository's default build still requires CI verification.
Related: #1188, #1189. This is the first of the planned smaller contributions; it does not close the Kotlin parity issue.
Companion split: #1191. Both PRs are independently based on upstream
main.