Migrate tests to JUnit5#1818
Migrate tests to JUnit5#1818MarkEWaite merged 3 commits intojenkinsci:masterfrom strangelookingnerd:migrate_to_junit5
Conversation
There was a problem hiding this comment.
Previously it was not possible to have more than one GitSampleRepoRule per test when using this extension.
As there are several examples of that being required in tests, I added it here.
I already noticed this requirement in some other plugins that could also benefit from this enhancement.
|
Even though the changeset is already huge, there is still plenty more room for improvements in code quality. |
* Migrate annotations and imports * Migrate assertions * Remove public visibility for test classes and methods * Minor code cleanup
There is definitely interest! Improvements to the test classes would be much appreciated. |
MarkEWaite
left a comment
There was a problem hiding this comment.
The test suite in the git plugin is used by other plugins. They consume the GitSampleRepoRule (as one example). As far as I can tell, this change will break those consumers.
Can the plugin still provide the GitSampleRepoRule and other dependencies that are needed for plugins that use it like these?
What change exactly? I don't think there is any breaking change hidden.
Since I did not remove the GitSampleRepoRule or change it in an incompatible way I would not see why not. My change to the GitSampleRepoExtension is also not problematic for consumers, quite the opposite should be the case. I am unaware of other classes that may be used by consumers e.g. as base classes for their tests. However I'd be willing to fix them in case we find any. |
Thanks very much for your willingness! When I apply the following patch to the copyartifact plugin it fails the LegacyJobConfigMigrationMonitorMigrationTest: If I switch the git plugin version from the incremental the version provided by the plugin BOM, then the tests pass. |
|
I'll look into it and see what change may be causing this 👍 |
|
Seems to be an issue with the JUnit version pulled by the copyartifact plugin vs. the git plugin. While that should be resolved when using the latest pom / bom for the time being reverting to the deprecated method call should be fine. Fixed in 2dbe72f. |
Pull request: * jenkinsci/git-plugin#1818 Testing done: * Confimed that many of the affected plugins pass tests locally `LINE=weekly PLUGINS=copyartifact,pipeline-maven,pipeline-model-definition,bitbucket-branch-source,workflow-multibranch,branch-api,workflow-support bash ./local-test.sh`
MarkEWaite
left a comment
There was a problem hiding this comment.
I've confirmed that tests pass in the plugin BOM with this change. Thanks!
This PR aims to migrate all tests to JUnit5. Changes include:
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