sending cucumber reports via jenkins Editable mail option - jenkins

please can you assist me.
I am new to jenkins, working on a POC for my organization. I have successfully integrated cucumber execution through jenkins and able to execute the scripts and generated cucumber reports using cucumber plugin successfully
Issue:
I need to send the cucumber reports(reports are getting generated under(C:\Users\username.jenkins\jobs\cucumbertest\builds) send anyone of those reports as an attachment to my manager through Editable email option in jenkins.
please can someone assist me

The following approach worked for me:
Cucumber project's pom.xml have to include maven-cucumber-reporting plugin.Because we want to create report under Target folder.How to configure your pom.xml: https://github.com/damianszczepanik/
Jenkins Manage Plugin and install Email-ext plugin & Post build task.
Report files js, html, etc. in folder but I think if we want to send them properly via mail, their extension must be zip. So, we create a batch file and put it into C:\Users\yourUser\.jenkins\workspace\yourProject.
I use 7-Zip ;
4.1 Open txt file in notepad,
4.2 Put the following script into the file
#echo off
setlocal
for /d %%x in (C:\Users\yourUser\.jenkins\workspace\yourProject\target\cucumber-html-reports*.*) do "C:\Program Files\7-Zip\7z.exe" a -tzip "%%x.zip" "%%x\"
endlocal
exit
4.3 save as .bat file. For Example I have new.bat
In Jenkins choose Post Build Task then I write C:\Users\yourUser.jenkins\workspace\yourProject\new.bat in area script
Then Editable Email Notification part Attachments part must be
**\**\cucumber-html-reports.zip

Related

How send folder as attachments in Jenkins Job Email Notification

I have A Jenkins Job with Workspace C:\hello_world\test_output*
in the test output folder, 2 things are one folder and one HTML file I want to send test output folder as a zip file as attachments on Jenkin jobs but I can't able to do it, please help
Think of it as two steps: 1) zipping the files; and 2) sending the attachment.
I've done this by installing 7zip, then running the command:
"C:\Program Files\7-Zip\7z.exe" a -r C:\hellow_world\test_output.zip C:\job\test_output\* - mem=AES256
With the https://plugins.jenkins.io/email-ext plugin installed, there's a lot of flexibility, including the ability to send attachments.
Bear in mind that some mail hosts example GMAIL have started blocking things like executables, even when found within zip files. If you've got users on such a host, you might run into trouble through no fault of your own.
Apart from that, depending on the OS that Jenkins is running on, you could add a post-build Execute shell or Execute Windows Batch command step that calls the zip tool of your choice, and send an e-mail with attachments using the email-ext plugin for example

How to skip report file generation on Allure-Report jenkins plugin?

i wanna know if there is a way to skip the report file generation on allure-report jenkins plugin on post-build action.
I want this because in my scenario i generate the files on build steps already (i need to check this archives before the build ends).
But then i need to call the allure plugin on post-build actions (to jenkins know that i'm using allure and show me the reports on build and build history).
But with this the plugin automatically generate the files again and i want use that ones that i've already created and cheked on build step.
Thanks

Xray for Jira Jenkins NUnit test results import task

Hi my Import job with Jenkins is failing with below error . I'm trying to import .xml from Slave machine. I can able to see .xml file in slave location but still getting the error for file not found . when we run the test from Master then it can able to search the xml . so can anyone help with this ?
ERROR: File path is a directory or the file doesn't exist
ERROR: Step ‘Xray: Results Import Task’ aborted due to exception:
java.io.IOException: java.io.IOException: File path is a directory or the
file doesn't exist
at
Looks like it is not able to findthe xml file. when i try to import same file using Curl command it is working . can any one help to solve it ?
I'm converting my Nunit xml to nunit2 for my HTML reporting . I tried to import nunit 2 converted xml manually and works fine but from Jenkins keep on getting error .
If you are able to add plugins to your Jenkins server, there is a plugin specifically to do this, but you won't find it on the Jenkins plugin manager, follow the steps here to install and configure;
Xray for JIRA Jenkins Plugin
In short;
Download this xray-for-jira-connector.hpi
Go to the Update Center of Jenkins ("Manage Jenkins" > "Manage Plugins")
Select the advanced tab
On the Upload Plugin section, click upload and select the file xray-for-jira-connector.hpi file.
Next you need to add your JIRA server configuration to Jenkins (Manage Jenkins > Configure System > Xray for JIRA configuration).
Once you have done the above, you should now be able to add a build step that can export Cucumber feature files from any Cucumber tests you have set up within Xray, and, a post-build action for importing test results files including an NUnit XML file.
All of the info here is described in more detail in the first link i provided, as well as additional information on how to setup the build step and post build action. Hope this helps.

Jenkins Email-ext plugin default Jelly script shows all unit tests, not just failed ones

I am using the Email-ext plugin on Jenkins, and the default Jelly script ${JELLY_SCRIPT,template="html"}.
The template apparently outputs all unit tests in the email, not just the ones that have failed and made the build unstable. This is in itself a strange design decision since the important content gets lost, but is there an easy way to just output the failed tests in the email? I suppose I need to edit the default Jelly script template somewhere? Thanks!
${JELLY_SCRIPT,template="html"} in this script html refers to the file html.jelly. In Hudson this file is located in the path, HUDSON_HOME/plugins/email-ext/WEB-INF/classes/hudson/plugins/emailext/templates. You can create your own jelly file, say abc.jelly and use the script as ${JELLY_SCRIPT,template="abc"}
However, in Jenkin this jelly templates have been bundled to the jar email-ext.jar which is located in Jenkin_Home/plugins/email-ext/WEB-INF/lib. Open this Jar and update/create templates in the location /plugins/emailext/templates/ as per your requirement.
There is an excellent example for how it is done using Jelly script in:
https://github.com/jenkinsci/email-ext-plugin/blob/master/src/main/resources/hudson/plugins/emailext/templates/html-with-health-and-console.jelly
-> Search for "JUnit TEMPLATE".
But more specifically it is done using
packageResult.getFailedTests()

Siebel compile integration with Jenkins CI

I have a task to configure Siebel compile with Jenkins CI tool. I dont know much about siebel. So, please suggest if anyone have ever configure these two before or anyone have some knowledge about integration or tools.
Thanks in advance.
Integrating Siebel build with Jenkins is pretty simple. Steps are as follow,
Add new jnlp slave(window machine) where you have install you toold.
Use repository tool to download object on you window machine. For SVN you can use silk svn or if you are using git them that can be directly integrated with your job as Jenkins provide plugin for same.
Define your folder structure with main folder. like for applet,bc,bo etc.
Call you siebdev.exe to import all object. You can do it by the option /batchimport. It will import all sif file present in directory
siebdev.exe " /c "D:\sea81\Tools_2\BIN\ENU\tools.cfg" /d "Local" /u "USER" /p "PASSWORD!" /batchimport "Siebel Repository" overwrite "d:\workspace_future\objects/Applet"
Once import is complete,start compiling.
tools.cfg" /d "Local" /u "USER" /p "PASSWORD!" /bc "Siebel Repository" "d:\workspace_future\built\siebel.srf"
Now you can also create Browser script, zip it and upload on any ftp system, which can be used to download files during integration.
There is many things which you can play with. For example I create a unique build file which contains repository with latest change, srf file, browser script,and other reference data like lov,system preference etc.
This might help you:
http://siebelunleashed.com/how-to-automate-siebel-full-compile/
It shows how to automate a siebel compilation. Use the first part (command line stuff) and put that in the "Execute Windows Batch Command" section of Jenkins.
I'm not sure how much experience you have with Jenkins, so if you need more details, please post a comment.

Resources