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

Deprecating RestartableJenkinsRule #926

Merged
merged 1 commit into from
Feb 26, 2025

Conversation

jglick
Copy link
Member

@jglick jglick commented Feb 21, 2025

I found that some plugin developers were unaware that this class had long since been superseded by JenkinsSessionRule.

* @since 1.567
* @deprecated New code should use {@link JenkinsSessionRule}.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm shouldn't new code use @WithJenkins (JUnit 5)? with which you can use .restart() directly on the jenkinsrule instance?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no experience with the JUnit 5 facilities and see no reason to ever switch from 4.

Regarding JenkinsRule.restart, I would not recommend it. It seems to make a copy of $JENKINS_HOME, which JenkinsSessionRule does not need to do. Also it does not support performing test steps in between Jenkins sessions, as JenkinsSessionRule does.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I‘m all for deprecating the rule. Overall I still think the transition towards JUnit5 is something we should promote rather than relying on a framework that is no longer maintained. I understand @jglick point that as of now there is little reason to switch, but that may change in the future.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something we should promote

You should add Javadoc to various 4-specific utilities noting their replacements.

@jglick jglick merged commit 7b34567 into jenkinsci:master Feb 26, 2025
15 checks passed
@jglick jglick deleted the RestartableJenkinsRule branch February 26, 2025 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants