-
Notifications
You must be signed in to change notification settings - Fork 748
Provide JUnit5 compatible alternative for RoundTripAbstractTest and RestartableJenkinsRule #2623
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
Provide JUnit5 compatible alternative for RoundTripAbstractTest and RestartableJenkinsRule #2623
Conversation
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.
This is a good example of how one can migrate from using RestartableJenkinsRule to JenkinsRule.restart()
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.
This is an example of how one can migrate from using RoundTripAbstractTest to AbstractRoundTripTest
| * text configured. | ||
| * | ||
| * @since 1.20 | ||
| * @deprecated Consider migrating to JUnit5 and use {@link io.jenkins.plugins.casc.misc.junit.jupiter.AbstractRoundTripTest} instead. |
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.
This is optional, but I'd like to make users aware of the alternative.
| * logger) that guarantees the config is loaded. Usually a weird text configured. | ||
| */ | ||
| @WithJenkins | ||
| public abstract class AbstractRoundTripTest { |
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.
I used a slightly different name besides a different package to reduce the risk of mix-ups. Not sure if this is the best way, so feedback is welcome.
...-harness/src/main/java/io/jenkins/plugins/casc/misc/junit/jupiter/AbstractRoundTripTest.java
Outdated
Show resolved
Hide resolved
...-harness/src/main/java/io/jenkins/plugins/casc/misc/junit/jupiter/AbstractRoundTripTest.java
Show resolved
Hide resolved
...-harness/src/main/java/io/jenkins/plugins/casc/misc/junit/jupiter/AbstractRoundTripTest.java
Show resolved
Hide resolved
...-harness/src/main/java/io/jenkins/plugins/casc/misc/junit/jupiter/AbstractRoundTripTest.java
Outdated
Show resolved
Hide resolved
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.
Thanks!
Now that jenkinsci/jenkins-test-harness#716 is available, it is possible to replace usage of
RestartableJenkinsRulein most scenarios.This change paves the way to provide a JUnit5-compatible implementation of
RoundTripAbstractTestthat does not rely onRestartableJenkinsRuleanymore.Your checklist for this pull request