-
Notifications
You must be signed in to change notification settings - Fork 334
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-39203] Mark JUnit steps with failing tests with WarningAction #118
Conversation
Co-authored-by: Andrew Bayer <andrew.bayer@gmail.com>
CI failure is because my Jenkinsfile changes are being ignored and the builds on 2.60.x are failing because plugins aren't able to load correctly. |
if (testResultAction.getResult().getFailCount() > 0) { | ||
int testFailures = testResultAction.getResult().getResultByNode(nodeId).getFailCount(); | ||
if (testFailures > 0) { | ||
node.addOrReplaceAction(new WarningAction(testFailures + " tests failed")); | ||
run.setResult(Result.UNSTABLE); |
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.
Another option would be for WarningAction.onAttached
to call Run.setResult
automatically. On the other hand I can imagine wanting this drastic effect to be explicit.
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 wasn't familiar with onAttached
previously, but I think you are referring to RunAction2.onAttached
. We certainly could make some changes in FlowNode
so that onAttached
and onLoad
would be called for actions implementing RunAction2
, but as you mentioned I think this particular effect is best left explicit.
src/main/java/hudson/tasks/junit/pipeline/JUnitResultsStepExecution.java
Outdated
Show resolved
Hide resolved
Ask to become a maintainer. |
Looks like you have some POM problems.
|
No, just Jenkinsfile problems (https://github.com/jenkinsci/junit-plugin/pull/118/files#diff-58231b16fdee45a03a4ee3cf94a9f2c3L1). I'll request to be a maintainer so my Jenkinsfile changes are used. |
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.
This feels very familiar for some reason... =)
See jenkinsci/workflow-api-plugin#91 and JENKINS-39203. (I am intentionally not updating the status of that ticket or assigning it to myself until I am ready to merge/release all relevant changes to avoid giving users premature hope of a fix and so that I have clear answers for what will and won't work and when any fixes will be released.) Subsumes and is based on #96.
This PR adds a
WarningAction
to theStepAtomNode
forjunit
steps with failing tests so that the actual stage containing thejunit
step can be visualized as unstable via jenkinsci/pipeline-graph-analysis-plugin#25.Desired reviewers: @abayer, @jglick, @car-roll