Skip to content

Migrate tests to JUnit Jupiter - #167

Merged
ogulcanaydogan merged 2 commits into
jenkinsci:masterfrom
strangelookingnerd:migrate_to_jupiter
Jul 23, 2026
Merged

Migrate tests to JUnit Jupiter#167
ogulcanaydogan merged 2 commits into
jenkinsci:masterfrom
strangelookingnerd:migrate_to_jupiter

Conversation

@strangelookingnerd

Copy link
Copy Markdown
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

@strangelookingnerd
strangelookingnerd requested a review from a team as a code owner November 11, 2025 10:34
@strangelookingnerd

Copy link
Copy Markdown
Contributor Author

@jenkinsci/ssh-agent-plugin-developers Kindly requesting a review.

strangelookingnerd and others added 2 commits July 22, 2026 11:08
* Migrate annotations and imports
* Migrate assertions
* Remove public visibility for test classes and methods
* Minor code cleanup
* Ban JUnit4 imports
The exec unit tests and the sshagent step tests were added after this
pull request was opened and still used JUnit 4, which the new banned
imports enforcer rejects. Migrate them to JUnit Jupiter so the whole
test tree is consistent.

Signed-off-by: Ogulcan Aydogan <[email protected]>
@ogulcanaydogan
ogulcanaydogan merged commit 2fddd76 into jenkinsci:master Jul 23, 2026
18 checks passed
sc.close();

assertEquals(socketFile.toString(), 2, socketFile.size());
assertEquals(2, socketFile.size(), socketFile.toString());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

WorkflowRun run = story.j.assertBuildStatusSuccess(job.scheduleBuild2(0));
story.j.assertLogContains("Failed to run ssh-agent -k", run);
WorkflowRun run = j.assertBuildStatusSuccess(job.scheduleBuild2(0));
j.assertLogContains("Failed to run ssh-agent -k", run);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

3 participants