I have test automation framework, and the test runs are driven through 
Jenkins. After the test run is completed, it generates a few custom test 
reports, as html file. In the report, i have a table with total number of 
errors as one of the column. I basically want to parse this html file and 
send out an email to a mailing list if the error is greater than 0.

Here is what i have done till now, in my Jenkins job:

a. Configured the job to run the tests [this is in an execute shell option 
and running my jar, as the test framework is a java application]
b. I have a post build action, in which i execute a python code, which does 
the following:

Step 1. Get the latest html report.
Step 2. Parse this file.
Step 3. If the error is > 0:
then email_flag = true
else:
email_flag = false.

Now is there a way i can use the above flags and send email notifications, 
via Jenkins plugins? I just want to understand the best way to do this. Any 
help is appreciated.

P.S. I did some additional research and i see the Email-ext plugin [
https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin] has a 
pre-send script option, but i just don't know how to use this to run the 
python code and handle the email messaging.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/8d43e8cb-d59c-4c9a-b732-8a1a029a813e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to