-
Notifications
You must be signed in to change notification settings - Fork 136
Add JUnit5 equivalents of JUnit4 Rule implementations #988
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
Conversation
timja
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a cursory glance it looks fine, best would be to try migrate a few plugins and see how it does.
b6dc41f to
ee2273c
Compare
76576cc to
b1dd1c2
Compare
b1dd1c2 to
6d15e78
Compare
What plugins have you migrated for each extension? |
I have some prepared, will create & link the PR. jenkinsci/throttle-concurrent-builds-plugin#302 -> JenkinsSessionExtension and BuildWatcherExtension |
|
Overall my approach seems to work just fine. I found a tiny issue with meta-annotations such as Should I add some more migrations or would the four linked above suffice? |
In the light of jenkinsci/throttle-concurrent-builds-plugin#302 (review) and jenkinsci/text-finder-plugin#255 (comment) I want to create JUnit5 equivalents for the most commonly used
Ruleimplementations:BuildWatcher->BuildWatcherExtensionInboundAgentRule->InboundAgentExtensionJenkinsSessionRule->JenkinsSessionExtensionRealJenkinsRule->RealJenkinsExtensionFeedback would be highly appreciated (ping @basil @timja @jglick)
The current state mostly copies the existing
*Ruleinto an*Extension, implementing the corresponding wrapper-methods of the respective framework.I don't like that this will likely cause the implementations to diverge at some point. However I failed to come up with a better solution that does not force me to refactor the entire thing. Something that would already help is to allow the classes to be compared more easily. Right now the formatting is all over the place -
spotlesscould help.Overall there is some very questionable coding, hacks and workarounds in both implementations, existing and new. I already removed some
deprecationsas well asTODOthat are no longer relevant. Another pair of eyes would however help here.As always, give me a ping if there any questions.
Testing done
I copied the existing tests for the rules above and adapted them to use JUnit5 and my
*Extensionimplementations.My main concern right now is that even the existing tests are only covering a small percentage of the functionallity provided, meaning there is a certain risk that some things simply do not work (yet).
Submitter checklist