-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Migrate tests to JUnit5 (core / jenkins / 3) #10578
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
Merged
NotMyFault
merged 9 commits into
jenkinsci:master
from
strangelookingnerd:migrate_to_junit5_core_3
May 29, 2025
Merged
Migrate tests to JUnit5 (core / jenkins / 3) #10578
NotMyFault
merged 9 commits into
jenkinsci:master
from
strangelookingnerd:migrate_to_junit5_core_3
May 29, 2025
Conversation
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
This was referenced Apr 22, 2025
1a717b8
to
0eb6e9d
Compare
1efe8db
to
1808e41
Compare
* Migrate annotations and imports * Migrate assertions * Remove public visibility for test classes and methods * Minor code cleanup
1808e41
to
c9de96e
Compare
Please take a moment and address the merge conflicts of your pull request. Thanks! |
# Conflicts: # core/src/test/java/jenkins/model/RunIdMigratorTest.java
NotMyFault
approved these changes
May 28, 2025
timja
approved these changes
May 28, 2025
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.
/label ready-for-merge
This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.
Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
internal
ready-for-merge
The PR is ready to go, and it will be merged soon if there is no negative feedback
skip-changelog
Should not be shown in the changelog
tests
This PR adds/removes/updates test cases
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.
This PR aims to migrate all tests in
core
(jenkins
package) to JUnit5. Changes include:Other, releated PR: #10559 #10576 #10577 #10578 #10579 #10580 #10581 #10582
Why this is a good change:
It is important to notice that this change should not alter the test logic, but bring the project in line with modern best practices and help keeping it future-proof.
There are some exceptions were tests have not been migrated (see the list below). The reasons vary per class, overall it's mostly either some custom
JenkinsRule
implementations that as of now do not properly work with JUnit5. There are also cases where a migration would simply require too much effort with too much risk of altering a tests intentions.List of test classes not migrated to JUnit5
I am well aware that this is a huge changeset however I hope that there is still interest in this PR and it will be reviewed.
If there are any questions, please do not hesitate to ping me.
Testing done
Lot's of local testing. Still there are some tests that do not run in my environement (with or without any changes).
Proposed changelog entries
Proposed changelog category
/label internal, tests
Proposed upgrade guidelines
N/A
Submitter checklist
@Restricted
or have@since TODO
Javadocs, as appropriate.@Deprecated(since = "TODO")
or@Deprecated(forRemoval = true, since = "TODO")
, if applicable.eval
to ease future introduction of Content Security Policy (CSP) directives (see documentation).Desired reviewers
Anyone really, it's a giant changeset with lots of repetitions.
Before the changes are marked as
ready-for-merge
:Maintainer checklist
upgrade-guide-needed
label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).lts-candidate
to be considered (see query).