Skip to content
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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

strangelookingnerd
Copy link
Contributor

Now that jenkinsci/jenkins-test-harness#716 is available, it is possible to replace usage of RestartableJenkinsRule in most scenarios.
This change paves the way to provide a JUnit5-compatible implementation of RoundTripAbstractTest that does not rely on RestartableJenkinsRule anymore.

This PR is still a little rough on the edges and therefore created as draft - however feedback is highly appreciated.

Your checklist for this pull request

  • Make sure you are requesting to pull a topic/feature/bugfix branch (right side) and not your master branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or in Jenkins JIRA
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Did you provide a test-case? That demonstrates feature works or fixes the issue.

@strangelookingnerd strangelookingnerd force-pushed the alternative_for_restartable_jenkins_rule branch from 35a739c to 942e4d0 Compare January 16, 2025 12:02
Copy link
Contributor Author

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()

Copy link
Contributor Author

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

@@ -44,7 +44,9 @@
* text configured.
*
* @since 1.20
* @deprecated Consider migrating to JUnit5 and use {@link io.jenkins.plugins.casc.misc.junit.jupiter.AbstractRoundTripTest} instead.
Copy link
Contributor Author

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 {
Copy link
Contributor Author

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.

@strangelookingnerd strangelookingnerd force-pushed the alternative_for_restartable_jenkins_rule branch 2 times, most recently from 22b3768 to 8dc5328 Compare January 16, 2025 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants