-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integration testing utilities for Jenkins plugins #2467
Comments
Hello from your friendly Jenkins Hosting Checker It appears you have some issues with your hosting request. Please see the list below and correct all issues marked Required. Your hosting request will not be approved until these issues are corrected. Issues marked with Warning or Info are just recommendations and will not stall the hosting process.
You can re-trigger a check by editing your hosting request or by commenting |
https://github.com/uhafner/plugin-testutil/blob/30c9cfc49b8888d6a0769621c89a60627ea17f73/pom.xml#L85-L96 + https://github.com/uhafner/plugin-testutil/blob/30c9cfc49b8888d6a0769621c89a60627ea17f73/pom.xml#L149-L161 makes me nervous; splitting the test harness for |
That could be checked via a bom incremental once this is hosted 👍 |
Possibly yeah. IIRC the problem was trickier—that the version of the test harness was not updated in tandem with the version of the plugin. I suppose that would not be an issue in this case because they live in separate repositories with independent version numbers. Just be really careful not to run afoul of the fragile logic in https://github.com/jenkinsci/maven-hpi-plugin/blob/9e82b7e370cc924f89f2748c76b1fda14267c2d3/src/main/java/org/jenkinsci/maven/plugins/hpi/HplMojo.java#L128-L139 + https://github.com/jenkinsci/maven-hpi-plugin/blob/9e82b7e370cc924f89f2748c76b1fda14267c2d3/src/main/java/org/jenkinsci/maven/plugins/hpi/AbstractHpiMojo.java#L516-L520. (Thinking about requiring plugins to enumerate a list of |
Is there a particular reason why this is a separate project rather than being added to the Jenkins test harness? I am a bit confused about why we need a separate project here. What exactly would be the criteria for adding something to this project as opposed to the official test harness? I think it would be preferable to avoid a repeat of e.g. (If this is just a matter of granting Dr Hafner commit access to |
My main motivation was that using JUnit 4 and 5 both in |
It is not so much that previous efforts did not work at all, but rather that previous efforts resulted in subtle changes in behavior that exposed pre-existing issues in the core test suite that required further investigation and debugging. That is part of the challenge of upgrading old libraries, a challenge with which I am very familiar (having done many such library upgrades, in the Jenkins project and elsewhere).
I think that solution makes sense in the short term, but we also have to think of the long-term health of the project as well. By exposing a new API and encouraging others to start using it, we take on technical debt. Then, when the long-term fix is made to the official Jenkins test harness, this technical debt will need to be unraveled: the code that was changed to depend on I think it would be better to focus our efforts to work together toward the completion of what was started in |
I agree that most of what is in My immediate concern is about the plugin deps, which are best avoided in test harness artifacts due to technical difficulties with Maven. I think you could do without. For example, the Pipeline deps seem to support just a small number of utilities related to defining jobs, which could be inlined, or if necessary proposed for addition to the |
Harmless enough only to the extent that plugins do not become dependent on these experimental APIs and force us to maintain these experimental APIs in the long term or laboriously migrate away from them. If the present author explicitly declares an intention to drive these APIs to completion in |
I see. I am fine with not publishing this as a separate library. So how should I proceed to use these JUnit 5 rules in my plugins then? Leaving them in the tests folder of https://github.com/jenkinsci/plugin-util-api-plugin (see jenkinsci/plugin-util-api-plugin#161)? Or will this cause the same problems? I simply do not want to copy the same things again and again for several of my plugins. |
Well, in my previous post I invited you to work together with us in
If you simply want to deduplicate functionality within your plugins and have no interest in generalizing it for the broader Jenkins community, I think that would be acceptable but disappointing, and would not block this request. |
I don't think that I have the knowledge and time to find the reason why the JUnit 5 dependencies break the core builds. These PRs have been proposed by several other volunteers (see jenkinsci/jenkins-test-harness#381 and jenkinsci/jenkins-test-harness#303). My goal simply was to make these rules available for plugins until this has been fixed in core. For the other topics, I am happy to help to improve the test harness (I already did in the past) by providing pull requests.
Ok. Then I will use them only in my plugins right now (the pull requests are all ready to be merged) and try to make them available for others in a step by step approach. |
Hi @uhafner, I did the work to reintegrate JUnit 5 support to the Jenkins test harness in jenkinsci/jenkins-test-harness#438, jenkinsci/jenkins#6657, and jenkinsci/plugin-pom#560 which has been successfully integrated as of the current weekly release and plugin parent POM. You can now adapt your plugins to use the official JUnit 5 integration. Let me know if I can be of any assistance. |
Yes, I noticed that. Thanks for finishing this new feature! I'll remove my copy of those extensions soon. |
Repository URL
https://github.com/uhafner/plugin-testutil
New Repository Name
lib-plugin-testutil
Description
Integration testing utilities for Jenkins plugins: this library contains all the testing utilities of https://github.com/jenkinsci/plugin-util-api-plugin so that they can be used easier for other plugins. Since the
test-jar
of the plugin-util-api-plugin does not declare its transitive dependencies, it makes sense to provide a new library that contains all those utilities that correctly provides the required transitive dependencies to run the tests.The following features are provided:
See jenkinsci/plugin-util-api-plugin#161 and the downstream PRs for the reasoning of this library.
GitHub users to have commit permission
@uhafner
Jenkins project users to have release permission
drulli
Issue tracker
Jira
The text was updated successfully, but these errors were encountered: