Has anyone created a simple email report that Jenkins sends out when nightwatch builds fail? or event converted junit reports to email reports?
I would like the following information in a concise report:
Failures
List of code changes
Who was the last people to commit
I don't have a public version, but let me try to offer some assistance how you can combine nodemailer with nightwatch-html-reporter.
I have a working nightwatch located at https://github.com/shane-reaume/nightwatch-bones
You should be able to see where the nightwatch-html-reporter code lives in the globals.js as...
var reporter = new HtmlReporter({
openBrowser: true,
reportsDirectory: __dirname + '/reports/',
themeName: 'default',
reportFilename: os.split(' ').join('-') + '-report.html'
});
Here you are creating an html file. With that you can extract the html for your nodemailer (see https://community.nodemailer.com/).
It seems to be relatively easy if you follow the directions on each, but let me know if you have trouble and I can try to throw something together.
i suggest you to go with the email-extension plugin.
follow the documentation https://wiki.jenkins.io/display/JENKINS/Email-ext+plugin
you can mail the reports as attachements to respective emails sepperating by commas
Related
I developed automated tests in Java. The XML test report is generated with junit 5 and xray-junit-extension. This XML is currently being integrated in Jira/Xray, but unfortunately the labels are not being added to the issue.
I believe that the labels could be integrated in two different ways, 1) through this XML test report, or, alternatively, 2) through the Jenkins pipeline itself.
My XML contains the following property :
Click here to see the screenshot
Similarly to what is written in the Xray documentation :
Click in order to see the screenshot of the documentation
https://docs.getxray.app/display/XRAY/Taking+advantage+of+JU...
The only difference is that in the Xray documentation there is a wrap around the tags property. In my XML I do not have that wrap.
Do you happen to have any idea on why the label is not being added in Jira/Xray?
The second approach would be using the XrayImportBuilder to add a label, using importInfo
step([$class: 'XrayImportBuilder',
endpointName: '/junit',
importFilePath: '/reports/.xml',
projectKey: 'P34AMA',
importToSameExecution: 'false',
//testExecKey: 'TSTLKS-753',
serverInstance: '3146a388-d399-4e55-ae28-8c65404d6f9d',
credentialId:'55287529-194d-4e91-9964-7d740d8d2f61',
importInfo: "{ "fields": {"labels": ["label"]}",
//importInfo = '{"fields": {"labels": ["EOD"]} }'
])
Problem using XrayImportBuilder in Jenkins
But when adding importInfo to my pipeline it ends with an issue :
Click here to see the Jenkins logs
Clcik here to see the Jenkins Import Step
Is anyone aware of any other way to add a label to jira automatically without using the hudson.plugins.jira.JiraIssueUpdater ?
Thank you very much for your help!
In my Jennkins pipeline I have a Jira/Xray integration step :
step([$class: 'XrayImportBuilder',
endpointName: '/xunit',
fixVersion: '1.0',
importFilePath: '/MyFirstUnitTests/TestResults.xml',
importToSameExecution: 'true',
testExecKey: 'TSTLKS-753',
serverInstance: '9146a388-e399-4e55-be28-8c65404d6f9d',
credentialId:'75287529-134d-4s91-9964-7h740d8d2i63'])
Currently I'm having the following error :
ERROR: Unable to confirm Result of the upload..... Upload Failed!
Status:400 Response:{"error":"Issue with key
\u0027TSTLKS-753\u0027 does not exist or is not of type Test
Execution."}
But my issue (TSTLKS-753) is of type "Test Execution":
It appears that the string "\u0027" is being added both as a prefix
and as a suffix on my issue when building the pipeline.
I've searched for this string and it appears to be a Quotation Mark:
I tried out replacing it by double quotes. But I end up with the same error. Also tried to remove them.
In any case, if someone already got this error please let me know. Thank you very much
Can you confirm that the user that you have configured in Jenkins for the Xray instance has access to that Jira project where you have your Test Execution issue?
Can you try to import it without specifying testExecKey field, with importToSameExecution: 'false', and specifying the projectKey field using something like projectKey: 'TSTLKS' ?
If this last option returns an error (e.g. "project does not exist") then it's for sure a permission issue, so you'll either need to use a different Jira user/pass or fix the permissions on Jira side.
I am learning Jenkins on my own and I am trying to learn about plugins. I have a stage to send an email with the cppcheck results with a template I found here the template instantiate the CppcheckBuildAction and access its methods, what I would like to know if is possible to check what methods are avaialable for that instance and if possible how / where I can see them.
Also how could I for example echo / println one of them. For instance in the template provided in the link above it acces the total number of errors with ${cppcheckResult.report.getNumberTotal()} but if I echo it I get an error groovy.lang.MissingPropertyException: No such property: cppcheckResult for class: groovy.lang.Binding, this is what I tried
stage('Email') {
steps {
script{
publishCppcheck pattern:'cppcheck.xml'
emailext( subject: 'foo', to: 'mail#mail.net', body: '${JELLY_SCRIPT, template="custom"}')
}
echo "${cppcheckResult.report.getNumberTotal()}"
}
}
my final goal actually is to send the email just when the report find a new error so I was thinking to save the total number of errors in an external file and compare it with each build and if the number is bigger send the email, is there any native / easier way to do this?
Most plugins should have a javadoc link. At bottom of plugin,should see javadoc
And then there's the Extension Index for core and plugins.
We are trying to use Jenkins pipeline and using the following function:
emailext attachmentsPattern: "${env.LOG_FILE}" , "${env.PASSED_SOURCES_LOG}", "${env.FAILED_SOURCES_LOG}",
body: "Hi,\nThe nightly integration tests run is completed. Please find the log attached to this email.",
subject: "NIGHTLY INTEGRATION TESTS RUN - ${BUILD_NUMBER}",
to: "${env.EMAIL}"
Unfortunatelly I could not find a way to put these multiple files in same email. It outputs error.
Would someone know how to declare it properly?
Cheers,
The attachmentsPattern takes an Ant file pattern so perhaps something like:
**/*.log
would work. Or you could collect the files by reading them and writing them to a single file and then attach that.
I try to integrate jenkins and Jira throught pipeline script. I try to create connection between two jira issues
1)my script (tasks INL-6613 and INL-6614 have already created) :
jiraLinkIssues type: 'предыдущая', inwardKey: 'INL-6613', outwardKey: 'INL-6614', site: 'TEST_JIRA'
just like into this documentation (https://jenkinsci.github.io/jira-steps-plugin/steps/issuelink/jira_link_issues/)
2)Also I configured site: 'TEST_JIRA' and it working 100%
3)I can't create link such as into documentation because I haven't use ordinary types :
4)But I have this problem :
{"errorMessages":["Не найдено ни одного типа связи запроса с именем 'предыдущая'."],"errors":{}}
({"errorMessages":["Not found any type of link query named 'предыдущая'."], "errors":{}})
Help me please fix it
Have you tried?
URL encode, change "предыдушая" on "%D0%BF%D1%80%D0%B5%D0%B4%D1%8B%D0%B4%D1%83%D1%88%D0%B0%D1%8F"
use latin symbols instead of cyrillic
I decided this problem with using " jiraGetIssueLinkTypes " -pipeline command, so I have seen that 'предыдущая' was just rename of 'link' type.