Hudson 测试失败电子邮件报告

发布于 2024-12-10 18:33:35 字数 746 浏览 5 评论 0 原文

我们使用 Hudson 作为我们的 CI 工具。 我想配置一个 hudson 作业来发送基于 Maven 的项目的失败测试的测试报告。 (在可编辑电子邮件配置部分中为不稳定版本配置邮件主题)

我使用了 http://techkriti.wordpress.com/2008/08/30/using-groovy-with-hudson-to-send-rich-text-email/

但是测试用例的链接不起作用,因为所需的链接包含与该测试用例对应的特定模块的 groupId$artifactId

必需的链接: job-url/groupId$artifactId/build-number/testReport/package-name/classname.testname/

但是我们使用以下格式获得的链接是:job-url/build-number/testReport/package-name/classname。 testname/

使用格式:$HUDSON_URL/job/$PROJECT_NAME/$BUILD_NUMBER/testReport/$packageName/$className/$testName

知道如何访问 groupId 和 artifactId从脚本?

谢谢,
加亚斯里

We use Hudson as our CI tool.
And i wanted to configure a hudson job to send the test report for failed tests for maven based project. (configuring mail subject for Unstable builds in editable email configuration section)

I used the template as suggested in http://techkriti.wordpress.com/2008/08/30/using-groovy-with-hudson-to-send-rich-text-email/

But the links to test cases aren't working as the required link contains groupId$artifactId of the particular module corresponding to that test case

Required link : job-url/groupId$artifactId/build-number/testReport/package-name/classname.testname/

But the link which we get using the following format is : job-url/build-number/testReport/package-name/classname.testname/

Used format : $HUDSON_URL/job/$PROJECT_NAME/$BUILD_NUMBER/testReport/$packageName/$className/$testName

Any idea how to access groupId and artifactId from the script ?

Thanks,
Gayathri

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

死开点丶别碍眼 2024-12-17 18:33:35

修改脚本中的变量 url,如下所示:(

def testResultVar = new hudson.tasks.test.SimpleCaseResult()
def url = tr.getRelativePathFrom(testResultVar)

如果参数不在其树中,getRelativePathFrom 方法将返回测试结果的绝对路径)

此解决方法解决了该问题。

谢谢,
加亚斯里

Modify the variable url in the script as follows:

def testResultVar = new hudson.tasks.test.SimpleCaseResult()
def url = tr.getRelativePathFrom(testResultVar)

(getRelativePathFrom method returns absolute path to the test result if the argument is not in its tree)

This workaround solves the issue.

Thanks,
Gayathri

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文