-
Notifications
You must be signed in to change notification settings - Fork 413
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
Post jenkins build output (console output) to slack #57
Comments
The Regarding including actual console output being posted to Slack; there is not currently a way for this to happen. I personally wouldn't find this useful but I don't use Jenkins nor the slack plugin (I only maintain pull requests and releases). If this is a feature you truly want you're welcome to contribute it. I don't actively develop this project. |
I concur with Sam. Our builds generate a lot of output (175k+) and this would have to be attached. I think it's a bit far from the notification purpose of the plugin and possibly a security issue too. The link in the slack post allows you to check the details of the build easily. |
I have a related issue. When Jenkins runs my python unit tests, the Slack message on failure is always "No Tests found" even though the console output shows Jenkins did find and run tests:
What do I need to do for the Slack notifications to give me the correct output? |
@rogthefrog that's a separate issue (better to be opened in a new issue). That has to do with how Jenkins collects unit tests. By default Jenkins only collects JUnit tests from Java. It's part of the test collection. I'm not sure if there's a workaround for surfacing python unit tests in Jenkins. |
@samrocketman ok, will do. Thank you. |
There's no reason a hyperlink to the latest console output cannot be included |
You can post the build log as a code snippet (that is actually the best option)! |
fabulous idea Dejan, can you point to any instructions on doing so? |
+1 |
No idea how, but I am assuming Slack API must give this option! :) |
So I know 0 about jenkins other than using it but it sounds like http://javadoc.jenkins-ci.org/hudson/model/Run.html#getLog(int) gives us what most of us want? and the text option for slacks api is https://api.slack.com/docs/attachments#text |
Yes, problem is that slack plugin for jenkins does not have this feature. |
+1 |
I was just experiencing this problem too. After seeing here that this option only supports JUnit, I used the following work around. I'm using xUnit to write my test results to an HTML file. So I just added a formatted link to the test results in the custom message.
This puts a Test Results link in the Slack notification which (duh) I can click to see the nicely formatted xUnit test results html content. |
@mikesigs thanks. this was super helpful. Where do you see how to format messages like this? I was trying a regular href tag and it was not working as expected. Your method worked great. |
@ezeeetm Glad it helped you! I found the info in the Slack API docs: https://api.slack.com/docs/formatting |
@mikesigs oh brother, now we have Slack Message Markup Language (SMML). The world already knew HTML! I guess (now that I look at it) there are some slack specific things that are easier to do this way. Thanks again! |
Really want this feature! |
There's an invite link on the README. Here's the link https://jenkins-slack-testing-signup.herokuapp.com |
I was able to get Slack to include the test results after I added the Publish Junit Test Result report. |
@jimthemighty , I was wondering if you could tell me how to set up slack to include the test results. Thank you |
Including |
@jeetendra-choudhary the only problem with URL is when Jenkins located inside VPC and have no access without VPN. So you cannot use it on your mobile(you actualy can connect to vpn etc... but not workable at all) |
Same here, not for slack but for gerrithub, would be better than link to console, the actual console output of failed tests (or even all the output) |
please reopen if still an issue, cleaning up the repo and this looks like it can be worked around easily, feel free to refile with a specific ask |
The request was to include the console log in notifications. (I would add that limiting it to the last N lines of the log would be desirable.) Calling Including a link to the log is a different use case, not a workaround. Please reopen. Thanks. |
Not sure how possible this is in pipeline with |
Why can't you just use the ${BUILD_LOG} jenkins macro in the custom message field? |
@dsteinmo |
Hi All, Same question Thank you. |
What test framework are you using? You should probably check JUnit XML reporter. It sends a test summary to the slack channel after test execution. |
Jenkins generate some outputs for each build, which is shown in "Console output" panel for each build.
Can I make the slack-plugin post that output to slack? Is this feature already available?
I tried checking the box " Include Test Summary" in the slack notification configuration. However, what I got on slack is "No Tests found."
The text was updated successfully, but these errors were encountered: