将 "test name: test result" 添加到 TFS 通知电子邮件
Adding "test name: test result" to TFS notification email
我有一个在 TFS 上进行单元测试的项目 运行 以及预定的构建。我收到电子邮件通知,例如:
Standard email notification on build completion
我需要将包含测试结果和测试错误消息的测试列表添加到通知邮件中。可以用 TFS 来做吗?
如果没有,我如何使用 "unit test name: result" (completed/failed) + 错误消息等单元测试数据为构建定义配置额外的步骤。
在电子邮件中添加带有测试结果的附件也是一个好主意。
请提供给我information/instructions/examples。
包含单元测试的项目使用 c# 和 MSTests 进行编码。
构建警报模板位于:
c:\Program Files\Microsoft Team Foundation Server 14.0\Application
Tier\TFSJobAgent\Transforms33\BuildCompletedEvent.xsl
找到您可以在其中进行自定义的模板。
此外,您可以编写一个 powershell 脚本来获取测试结果然后发送电子邮件。然后 运行 TFS 构建中的这个脚本。
使用 TFS RESI API 获取测试结果:
使用 powershell 发送电子邮件:https://practical365.com/exchange-server/powershell-how-to-send-email/
这里还有另外一个有代码的博客:http://chamindac.blogspot.sg/2015/10/send-test-result-email-after-running.html
我有一个在 TFS 上进行单元测试的项目 运行 以及预定的构建。我收到电子邮件通知,例如: Standard email notification on build completion
我需要将包含测试结果和测试错误消息的测试列表添加到通知邮件中。可以用 TFS 来做吗? 如果没有,我如何使用 "unit test name: result" (completed/failed) + 错误消息等单元测试数据为构建定义配置额外的步骤。 在电子邮件中添加带有测试结果的附件也是一个好主意。
请提供给我information/instructions/examples。
包含单元测试的项目使用 c# 和 MSTests 进行编码。
构建警报模板位于:
c:\Program Files\Microsoft Team Foundation Server 14.0\Application Tier\TFSJobAgent\Transforms33\BuildCompletedEvent.xsl
找到您可以在其中进行自定义的模板。
此外,您可以编写一个 powershell 脚本来获取测试结果然后发送电子邮件。然后 运行 TFS 构建中的这个脚本。
使用 TFS RESI API 获取测试结果:
使用 powershell 发送电子邮件:https://practical365.com/exchange-server/powershell-how-to-send-email/
这里还有另外一个有代码的博客:http://chamindac.blogspot.sg/2015/10/send-test-result-email-after-running.html