Skip to content

Migrate tests to JUnit Jupiter#389

Merged
jglick merged 1 commit intojenkinsci:masterfrom
strangelookingnerd:migrate_to_jupiter
Nov 5, 2025
Merged

Migrate tests to JUnit Jupiter#389
jglick merged 1 commit intojenkinsci:masterfrom
strangelookingnerd:migrate_to_jupiter

Conversation

@strangelookingnerd
Copy link
Contributor

This PR aims to migrate all tests to JUnit Jupiter. Changes include:

  • Migrate annotations and imports
  • Migrate assertions
  • Remove public visibility for test classes and methods
  • Minor clean up
  • Ban JUnit4 imports

I am well aware that this is a quite large 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.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

* Migrate annotations and imports
* Migrate assertions
* Remove public visibility for test classes and methods
* Minor code cleanup
* Ban JUnit4 imports
@strangelookingnerd strangelookingnerd requested a review from a team as a code owner November 5, 2025 10:46
@jglick jglick added the tests label Nov 5, 2025
Comment on lines +227 to +231
"""
sh '''
cat "$THEKEY" > key.txt\
'''
""";
Copy link
Member

Choose a reason for hiding this comment

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

Stuff like this is obviously a mess, but would need to be fixed up more manually by a human looking at the test case and formatting it nicely. I would prefer it if you would not try to convert multiline strings to text blocks as part of PRs like this. It has nothing to do with JUnit 5 and just makes it that much harder to review, and often makes the code less legible.

Comment on lines -52 to +68
@Rule public FlagRule<Boolean> useWatching = new FlagRule<>(() -> DurableTaskStep.USE_WATCHING, v -> DurableTaskStep.USE_WATCHING = v);
@AfterEach
void afterEach() {
DurableTaskStep.USE_WATCHING = useWatching;
Copy link
Member

Choose a reason for hiding this comment

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

Clumsier IMO.

@jglick jglick merged commit 91a44ce into jenkinsci:master Nov 5, 2025
18 checks passed
@strangelookingnerd strangelookingnerd deleted the migrate_to_jupiter branch November 5, 2025 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants