groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pradeep <bubunia2000s...@gmail.com>
Subject groovy email template script help.
Date Tue, 22 Nov 2016 08:46:25 GMT
Hi,

I have written a groovy template script to be integrated to the E-mail Extn
plugin in Jenkins for sending customised reports.

The idea is to to parse the jUNIT Test reports from Jenkins and add the test
results in a tabular format. The problem is the "Test Pass Count", "Test
Fail Count", "Test status" is not reflected in a table result. I tried to
add some of the JUNIT parse code and tried to add to the table but it gives
lot of syntax errors. Can anyone please help me in this regard?

In short  I need to have table with Test Name, Test Status,Pass, Fail, Total
values populated in the table.

Regards
Bubunia





 

  	Test Name 
  	Test Status
  	Pass
  	Fail
  	Total
 





<% def junitResultList = it.JUnitTestResult
try {
 def cucumberTestResultAction =
it.getAction("org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResultAction")
 junitResultList.add(cucumberTestResultAction.getResult())
} catch(e) {
        //cucumberTestResultAction not exist in this build
}
if (junitResultList.size() > 0) { %>
 

 
${junitResultList.first().displayName}
 <% junitResultList.each{
  junitResult -> %>
     <% junitResult.getChildren().each { packageResult -> %>
        
 ${packageResult.getName()}
${packageResult.getFailCount()},${packageResult.getPassCount()},${packageResult.getSkipCount()},${packageResult.getPassCount()+packageResult.getFailCount()+packageResult.getSkipCount()}
        <% packageResult.getFailedTests().each{ failed_test -> %>
          
<li>Failed: ${failed_test.getFullName()} </li>
        <% }
      }
 } %>
 

 <BR/>
<%
} %>





--
View this message in context: http://groovy.329449.n5.nabble.com/groovy-email-template-script-help-tp5736878.html
Sent from the Groovy Users mailing list archive at Nabble.com.

Mime
View raw message