Skip to content

Conversation

@strangelookingnerd
Copy link
Contributor

@strangelookingnerd strangelookingnerd commented Jul 28, 2025

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
@strangelookingnerd strangelookingnerd marked this pull request as ready for review August 8, 2025 17:50
@strangelookingnerd strangelookingnerd requested a review from a team as a code owner August 8, 2025 17:50
strangelookingnerd and others added 8 commits August 13, 2025 10:50
# Conflicts:
#	src/test/java/org/jenkinsci/plugins/workflow/log/FileLogStorageTest.java
Bumps [org.jenkins-ci.plugins:plugin](https://github.com/jenkinsci/plugin-pom) from 5.24 to 5.26.
- [Release notes](https://github.com/jenkinsci/plugin-pom/releases)
- [Changelog](https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md)
- [Commits](jenkinsci/plugin-pom@plugin-5.24...plugin-5.26)

---
updated-dependencies:
- dependency-name: org.jenkins-ci.plugins:plugin
  dependency-version: '5.26'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [org.awaitility:awaitility](https://github.com/awaitility/awaitility) from 4.2.2 to 4.3.0.
- [Changelog](https://github.com/awaitility/awaitility/blob/master/changelog.txt)
- [Commits](awaitility/awaitility@awaitility-4.2.2...awaitility-4.3.0)

---
updated-dependencies:
- dependency-name: org.awaitility:awaitility
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
# Conflicts:
#	src/test/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest.java
jglick
jglick previously requested changes Oct 23, 2025
Comment on lines 78 to 81
public class ArtifactManagerTest {
@WithJenkins
class ArtifactManagerTest {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll look into it. On a side-note: Is there a clever way for me to find these kind of dependencies or to you just happen to know them?

Copy link
Member

Choose a reason for hiding this comment

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

In this case I wrote the class and some of its subclasses so I just happened to remember that this was being used as a test utility, not only a suite here. And I have had to make matching changes in the past for various reasons, like migrating away from docker-fixtures.

It is not immediately apparently that just restoring public would suffice; you would need to try updating at least one subclass to use the Jupiter version and verify that it still runs as a test (and, of course, passes).

Copy link
Member

Choose a reason for hiding this comment

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

https://github.com/search?type=code&q=org%3Ajenkinsci+NOT+is%3Aarchived+ArtifactManagerTest FTR (I use a Firefox bookmarklet for this sort of search).

* All {@link FlowNode}s will this result in calling {@link SimpleChunkVisitor#atomNode(FlowNode, FlowNode, FlowNode, ForkScanner)}
*/
public class NoOpChunkFinder implements ChunkFinder {

Copy link
Member

Choose a reason for hiding this comment

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

In general I would prefer to avoid gratuitous formatting changes as part of a PR which is not just formatting changes (which should rather be one to enable Spotless).

@jglick jglick dismissed their stale review October 24, 2025 20:16

addressed (still TBD whether the subclassing works though)

@strangelookingnerd
Copy link
Contributor Author

I validated the changes in jenkinsci/artifact-manager-s3-plugin#679 (JUnit 4) as well as in jenkinsci/artifact-manager-s3-plugin#664 (JUnit Jupiter). Changes appear to be working fine in both variants. As always I'd of course be available to fix any issues that may come up regardless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants