2016-03-08 49 views

回答

0

允許我回答自己:你只需要更新了一下現有的HTML EMIAL通知:https://github.com/jenkinsci/email-ext-plugin/blob/master/src/main/resources/hudson/plugins/emailext/templates/html.jelly 閱讀本也知道在哪裏把新文件: https://wiki.jenkins-ci.org/pages/viewpage.action?pageId=59506969 複製文件的這一部分

<!-- JUnit TEMPLATE --> 

<j:set var="junitResultList" value="${it.JUnitTestResult}" /> 
<j:if test="${junitResultList.isEmpty()!=true}"> 
    <TABLE width="100%"> 
    <TR><TD class="bg1" colspan="2"><B>JUnit Tests</B></TD></TR> 
    <j:forEach var="junitResult" items="${it.JUnitTestResult}"> 
     <j:forEach var="packageResult" items="${junitResult.getChildren()}"> 
     <TR><TD class="bg2" colspan="2"> Name: ${packageResult.getName()} Failed: ${packageResult.getFailCount()} test(s), Passed: ${packageResult.getPassCount()} test(s), Skipped: ${packageResult.getSkipCount()} test(s), Total: ${packageResult.getPassCount()+packageResult.getFailCount()+packageResult.getSkipCount()} test(s)</TD></TR> 
     <j:forEach var="failed_test" items="${packageResult.getFailedTests()}"> 
      <TR bgcolor="white"><TD class="test_failed" colspan="2"><B><li>Failed: ${failed_test.getFullName()} </li></B></TD></TR> 
     </j:forEach> 
     </j:forEach> 
    </j:forEach> 
    </TABLE> 
<BR/> 
</j:if> 

再次貼吧稍微改變它:

<!-- JUnit TEMPLATE --> 

<j:set var="junitResultList" value="${it.JUnitTestResult}" /> 
<j:if test="${junitResultList.isEmpty()!=true}"> 
    <TABLE width="100%"> 
    <TR><TD class="bg1" colspan="2"><B>JUnit Tests</B></TD></TR> 
    <j:forEach var="junitResult" items="${it.JUnitTestResult}"> 
     <j:forEach var="packageResult" items="${junitResult.getChildren()}"> 
     <TR><TD class="bg2" colspan="2"> Name: ${packageResult.getName()} Failed: ${packageResult.getFailCount()} test(s), Passed: ${packageResult.getPassCount()} test(s), Skipped: ${packageResult.getSkipCount()} test(s), Total: ${packageResult.getPassCount()+packageResult.getFailCount()+packageResult.getSkipCount()} test(s)</TD></TR> 
     <j:forEach var="passed_test" items="${packageResult.getPassedTests()}"> 
      <TR bgcolor="white"><TD class="test_passed" colspan="2"><B><li>Passed: ${passed_test.getFullName()} </li></B></TD></TR> 
     </j:forEach> 
     </j:forEach> 
    </j:forEach> 
    </TABLE> 
<BR/> 
</j:if>