-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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-51913] Prevent archiveArtifacts
from displaying a stack trace when no artifacts are found
#6475
Conversation
thanks @basil for the assist on the errors in the test. |
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.
Thanks for the PR!
archiveArtifacts
from displaying a stack trace when no artifacts are found
This PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback. Please see the merge process documentation for more information about the merge process. Thanks! |
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.
Thanks! I saw the ping a couple weeks ago but just did not have time to dig in.
FreeStyleBuild build = j.buildAndAssertSuccess(project); | ||
assertFalse(project.getBuildByNumber(1).getHasArtifacts()); | ||
j.assertLogContains("No artifacts found that match the file pattern \"" + pattern + "\"", build); | ||
assertThat("No stacktrace shown", build.getLog(31), Matchers.iterableWithSize(lessThan(30))); |
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.
Or more directly could do something along the lines of
assertThat("No stacktrace shown", build.getLog(), not(containsString("\tat ")));
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.
But then that would be inconsistent with other code in this file.
Re-implementation of #4913
See JENKINS-51913.
Testing
Added a test to validate that there isn't a stack trace, and that the error is present.
Proposed changelog entries
Do not print a stack trace when archiveArtifact does not find a file.
Proposed upgrade guidelines
N/A
Submitter checklist
Proposed changelog entries
section only if there are breaking changes or other changes which may require extra steps from users during the upgradeDesired reviewers
@basil @jackgene
Maintainer checklist
Before the changes are marked as
ready-for-merge
:Proposed changelog entries
are correctupgrade-guide-needed
label is set and there is aProposed upgrade guidelines
section in the PR title. (example)lts-candidate
to be considered (see query).Misc
Shout out to @adrianjgeorge for helping me out :D