Skip to content

Migrate tests to JUnit5#562

Merged
kuisathaverat merged 2 commits intojenkinsci:mainfrom
strangelookingnerd:migrate_to_junit5
Feb 25, 2025
Merged

Migrate tests to JUnit5#562
kuisathaverat merged 2 commits intojenkinsci:mainfrom
strangelookingnerd:migrate_to_junit5

Conversation

@strangelookingnerd
Copy link
Contributor

This PR aims to migrate all tests to JUnit5. Changes include:

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

There is one exception where a migration was not possible as the tests rely on Rule implementations that have not (yet) been migrated to JUnit5:

  • SSHLauncherTest using DockerRule

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.

  • 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
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@strangelookingnerd strangelookingnerd requested a review from a team as a code owner February 21, 2025 13:47
@strangelookingnerd
Copy link
Contributor Author

strangelookingnerd commented Feb 21, 2025

On a side-note: Is there any reason the agent tests should not run on windows? They work just fine from what I can tell.

(https://github.com/strangelookingnerd/ssh-agents-plugin/blob/6773a62ce36027352a762a7f371cb459a2191b4e/src/test/java/hudson/plugins/sshslaves/agents/AgentConnectionBaseTest.java#L65)

@strangelookingnerd strangelookingnerd marked this pull request as draft February 21, 2025 14:15
* Migrate annotations and imports
* Migrate assertions
* Remove public visibility for test classes and methods
* Minor code cleanup
@strangelookingnerd strangelookingnerd marked this pull request as ready for review February 21, 2025 15:03
Co-authored-by: Ivan Fernandez Calvo <kuisathaverat@users.noreply.github.com>
@kuisathaverat
Copy link
Contributor

On a side-note: Is there any reason the agent tests should not run on windows? They work just fine from what I can tell.

A long time ago, we ran them on Windows too; they were too flaky in Windows. Due to these, IT verifies several SSH server configurations that work with the SSH build Agents plugins; thus, running them in Windows does not have much value.

@kuisathaverat kuisathaverat merged commit e2c6128 into jenkinsci:main Feb 25, 2025
15 checks passed
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