How can I write a Jenkins email-ext template to display test results like the standard test report

后端 未结 5 1395
暗喜
暗喜 2020-12-23 22:27

I have tweaked the standard jelly template to display the current test results in a table, however I really want to be able to display diffs as seen in Jenkins own test resu

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-23 23:26

    Write a Groovy template for Email Ext plugin instead of Jelly template. In Groovy template you'll have access to Build object for your build. You can then call getTestResultAction on it to obtain the AbstractTestResultAction for the build which you can then query for everything you need.

    Here is a link to Jenkins Main Module API. A sample Groovy template for Ext Email plugin could be found in $JENKINS_HOME/plugins/email-ext/WEB-INF/classes/hudson/plugins/emailext/templates/groovy-html.template. More info on Groovy template/script usage can be found in Email Ext plugin documentation.

提交回复
热议问题