Repository navigation
Run the Cucumber JUnit Platform suite migration from JUnit4to5Migration - #1178
Merged
Merged
Conversation
…ion` `JUnit4to5Migration` removed `junit:junit` but left `@RunWith(Cucumber.class)` in place, so acceptance tests run by the Cucumber JUnit 4 runner no longer compiled. rewrite-cucumber-jvm's `CucumberToJunitPlatformSuite` now converts that runner to a JUnit Platform `@Suite` (openrewrite/rewrite-cucumber-jvm#67), so the migration runs it, with rewrite-cucumber-jvm as a runtime dependency.
… migrated `CucumberToJunitPlatformSuite` now also turns the class-level setup and teardown of a runner into `@BeforeSuite` and `@AfterSuite`, so it runs ahead of `UpdateBeforeAfterAnnotations`, converting the runner from its JUnit 4 annotations rather than from the `@BeforeAll` that recipe would leave.
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.
JUnit4to5Migrationremovedjunit:junitbut left@RunWith(Cucumber.class)in place, so acceptance tests run by the Cucumber JUnit 4 runner failed to compile withpackage org.junit.runner does not exist. The migration now runs rewrite-cucumber-jvm'sCucumberToJunitPlatformSuite(openrewrite/rewrite-cucumber-jvm#67), which converts that runner and its@CucumberOptionsto a JUnit Platform@Suite, and adds rewrite-cucumber-jvm as aruntimeOnlydependency, as is already done forerror-prone-contrib. It runs right afterRemoveObsoleteRunners, beforeUpdateBeforeAfterAnnotations, as it turns a runner's@BeforeClassand@AfterClassinto@BeforeSuiteand@AfterSuite. A new end-to-end test inJUnit5MigrationTestcovers a runner with class-level setup and its pom, for whichcucumber-junitis added to the test type tables, andrecipes.csvis regenerated with the new recipe counts.