-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
Always collect test results after running the build in buildPlugin()
and buildPluginWithGradle()
#88
Always collect test results after running the build in buildPlugin()
and buildPluginWithGradle()
#88
Conversation
I am not sur ewhether it is still actual, but there is a massive merge conflict we would need to address |
c1dd6c9
to
b6bee6c
Compare
I just fixed the merge conflict. It has been that massive because the indentation changed. The pull request can be more easily reviewed if ignoring whitespace changes. Only a |
Ideally we should detach Gradle build to a separate Pipeline step. There are too many things which are not really compatible with Gradle in the new flow, e.g. Jenkins version specifications. It would be better to have a clean If someone is interested to migrate Gradle plugins, I am happy to help with implementing the change |
FTR I tried to do some refactoring in #21 to enable parallelized builds. Some code can be reused, once we solve the autodiscovery problem (requires extra |
I don't have a lot of context here, but if this is the original problem:
I think you can do this with an initscript that takes a property from the command line. Something like this works:
Running a build with a failing test:
Same build completed successfully with the property set:
This seems reasonable to me.
Is there a listing of these somewhere I could read through? |
@sghill Yes the original problem was about
...and due to it no test results beeing collected on failure. @oleg-nenashev I don't have the capacity to extract the Gradle build into a separate build step as suggested by you. This pull request is the only thing I can provide for now. |
For some reason, I missed this particular PR and I raised another one, which includes the UTs:
|
vars/buildPlugin.groovy
Outdated
testReports = '**/build/test-results/**/*.xml' | ||
} | ||
junit testReports | ||
// TODO do this in a finally-block so we capture all test results even if one branch aborts early |
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.
Not anymore with this PR:
// TODO do this in a finally-block so we capture all test results even if one branch aborts early |
b6bee6c
to
dd214d4
Compare
Sorry for not handling it. Too many things here and there :( |
@sghill Based on new information from @wolfs I would even go without test.ignoreFailures now because it is not a good idea with respect to the Gradle build cache - see jenkinsci/gradle-plugin#93 (comment). |
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.
Maybe you want to set a flag to prevent the Pipeline from failing on missing reports.
@v1v You could also follow up on this in your pull request because you already updated the tests. I think the main question that should be answered is, if the |
@oleg-nenashev I guess you are talking about |
This should especially fix test results collection for Gradle, where it is not possible to set test.ignoreFailures [1] from the commandline. [1] https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html#org.gradle.api.tasks.testing.Test:ignoreFailures
dd214d4
to
b74236d
Compare
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 agree with the patch. NNote that it will cause regressions in Gradle-based components which have not yet switched to buildPluginWithGradle()
. Should we finish the migration first?
What kind of regressions do you think of? Maybe I am missing something. The intention was that the new |
I will have a look, now that I am more familiar with these kind of tests. |
No worries, I just misread the code. My apologies |
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 am fine with merging it as is, we can do tests in a follow-up if you prefer so @darxriggs @v1v
@oleg-nenashev Then please already merge it. I will have to prepare 1 or 2 other pull requests to get the tooling ready for the tests. |
buildPlugin()
and buildPluginWithGradle()
This should especially fix test results collection for Gradle, where it's not possible to set test.ignoreFailures from the commandline.
I put this for discussion here as I am not 100% sure if it doesn't brake something in the case of errors. E.g. that archiving is triggered but not working as expected.