Skip to content

Migrate tests to JUnit5#465

Merged
jglick merged 11 commits into
jenkinsci:masterfrom
strangelookingnerd:migrate_to_junit5
May 12, 2026
Merged

Migrate tests to JUnit5#465
jglick merged 11 commits into
jenkinsci:masterfrom
strangelookingnerd:migrate_to_junit5

Conversation

@strangelookingnerd

@strangelookingnerd strangelookingnerd commented Jul 28, 2025

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

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
# Conflicts:
#	src/test/java/org/jenkinsci/plugins/workflow/support/steps/ExecutorStepTest.java
@strangelookingnerd strangelookingnerd marked this pull request as ready for review August 11, 2025 07:05
@strangelookingnerd strangelookingnerd requested a review from a team as a code owner August 11, 2025 07:05
@jglick jglick added the tests label May 12, 2026
}

@Parameterized.Parameter public boolean useWatching;
@ParameterizedClass(name = "watching={0}")

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.

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.

assumeFalse("TODO Windows version TBD", Functions.isWindows());
@Test
void scriptExitingDuringShutdown() throws Throwable {
assumeFalse(Functions.isWindows(), "TODO Windows version TBD");

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.

More idiomatically, @DisabledOnOS.

Comment on lines -433 to +452
@TestExtension("remoteLogger[watching=true]") public static class LogFile implements LogStorageFactory {
@TestExtension("remoteLogger") public static class LogFile implements LogStorageFactory {

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.

note

void remoteLogger() throws Exception {
assumeTrue(useWatching);

@jglick jglick merged commit 46cb22f into jenkinsci:master May 12, 2026
18 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