是否可以设置 TFS/Test Manager 以便在测试失败后发送电子邮件?
问问题
689 次
1 回答
3
Yes, it is possible but it requires quite a lot of changes/additions to the process template and possibly a custom-made activity.
- After tests have run, we check if
BuildDetail.BuildPhaseStatus
has statusfailed
- We send mail to everyone who has changesets committed to this build, so the build goes through
BuildDetail.AssociatedChangesets
(you need to haveAssociateChangesetsAndWorkItems
on) and get the committer username. - Unfortunately for us, there's no good correlation between TFS username and email address at our place, so we had to create a custom activity that looks that up in the AD.
- The actual email is sent with the
BuildReport
action from Community TFS Build Extensions. We modified the xslt, but that's not really necessary. We also wanted to include a listing of the failed tests, and that required modification of the action itself (test data isn't included by default).
Looking at this description and all the work made to get this working, I'm beginning to wonder if it was worth it ;).
于 2012-10-20T18:54:10.610 回答