-
Notifications
You must be signed in to change notification settings - Fork 89
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
[JENKINS-45047] Support for plugin-to-plugin integration tests #66
Conversation
… using project properties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still relevant?
Yes I think so; there is still a pressing need for this feature and no good alternative that I know of. Whether I am going to have enough time to work on it is another question. |
…into plugin-ITs-JENKINS-45047
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to completing the merge in jglick#1 I had an idea about how to fix one of the TODOs.
@SuppressWarnings("unchecked") | ||
public Map<String, String> upperBounds() { | ||
Map<String, String> r = new HashMap<>(); | ||
// TODO this does not suffice; does not find that workflow-api needs to go from 2.11 to 2.16, presumably because it was not a direct dependency to begin with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think to resolve this we would need to mutate the shadow Project
with the results of this method call, then re-do dependency resolution (i.e., do the equivalent of LifecycleDependencyResolver#getDependencies
), keeping track of the versions before and after (re-)resolution, then apply the difference to overrideVersions
map.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mutate the shadow Project with the results of this method call
To clarify, I mean doing this the same way you would if editing the POM manually: in the case of a direct dependency, by adjusting the version; in the case of a transitive dependency, by adding a new entry to the dependency management section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Sounds tricky but could work. (Bringing this PR over the finish line would require some dedicated attention, and in general my workday only allows for a few minutes here and there on Jenkins infra stuff.) Thanks for helping think about it.
Done in commit 42b83f5, and with that both of the new ITs are passing. I think we can cross off The next task is "load versions from megawar". I don't really know or understand what a megawar is. It would be cool if you could take a whack at that when you have time. |
I wrote some hacks in PCT and BOM to test this out against the 100 plugins in the BOM managed set, and it seems to work OK, modulo one issue in |
Can we work on this in a collaborative fashion? For example, you merge my branch into yours, you give me commit access to it, and then we both push commits until it's done. If you are just going to sit back while I do all the coding, then fine, but then please do not leave questions and suggestions in a code review in the final PR when I am done. |
If you are actively working on this then I would suggest you open your own PR (whether from a fork or an origin branch). I can make no time commitments and I would hate to be a bottleneck, especially since you seem to have a clear idea of the goal and how to accomplish it at least for the BOM/PCT usage mode. (The original idea is actually much older and was oriented toward including tests of manually selected downstream plugins in an upstream plugin’s As always, you are free to ignore questions and suggestions which do not seem helpful. I do my best to leave comments earlier rather than later but that gets difficult when there are dozens of GH notifications in my inbox. In the unusual case that I think a PR from a regular contributor is actually making things worse (or introduces API commitments we should not), I will “request changes” until convinced otherwise or other experienced contributors think differently. |
I will file my own PR and keep you credited as the co-author. Can you at least specify the API you had in mind for this (i.e. command-line flag and semantics)? It seems clear that you had a very specific vision for this, so I am trying to stay faithful to that in order to accommodate your original use case. |
I started this five years ago 😢 and there is not a specific mojo / property interface I had in mind; whatever seems convenient. There are two basic use cases:
buildPlugin(downstream: ['workflow-cps-global-lib']) which would do something conceptually like mvn -f workflow-cps-plugin install
# also on Windows in parallel, etc., like the main part of buildPlugin() today
version=$(mvn -f workflow-cps-plugin -Dset.changelist -Dexpression=project.version -q -DforceStdout help:evaluate)
for downstream in workflow-cps-global-lib-plugin
do
mvn -f $downstream -Doverrides=workflow-cps=$version -Dmaven-hpi-plugin.disabledTestInjection test
done ideally using |
For the |
JENKINS-45047: offers a way to override a plugin’s dependency versions (on Jenkins core and/or other plugins) just before
surefire:test
is about to run, without editingpom.xml
asplugin-compat-tester
currently does nor relying on the existence of overridable POM properties.overrideVersions
useUpperBounds
buildPlugin.groovy