简体   繁体   English

设置TFS /测试管理器以在测试失败时发送电子邮件

[英]Setup TFS/Test Manager to send email on test failure

是否可以设置TFS /测试管理器,以便在测试失败后发送电子邮件?

Yes, it is possible but it requires quite a lot of changes/additions to the process template and possibly a custom-made activity. 是的,这是可能的,但是它需要对流程模板进行大量更改/添加,并且可能需要进行定制的活动。

  1. After tests have run, we check if BuildDetail.BuildPhaseStatus has status failed 测试运行后,我们检查BuildDetail.BuildPhaseStatus是否状态为failed
  2. We send mail to everyone who has changesets committed to this build, so the build goes through BuildDetail.AssociatedChangesets (you need to have AssociateChangesetsAndWorkItems on) and get the committer username. 我们将邮件发送给已对此变更提交了变更集的所有人,因此该构建将通过BuildDetail.AssociatedChangesets (您需要BuildDetail.AssociatedChangesets AssociateChangesetsAndWorkItems )并获取提交者用户名。
  3. 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. 对于我们来说不幸的是,在我们的位置,TFS用户名和电子邮件地址之间没有很好的相关性,因此我们必须创建一个自定义活动,以在AD中进行查找。
  4. The actual email is sent with the BuildReport action from Community TFS Build Extensions. 实际的电子邮件与BuildReport操作一起从Community TFS Build Extensions发送。 We modified the xslt, but that's not really necessary. 我们修改了xslt,但这并不是必须的。 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 ;). 查看此描述以及为使该工作而进行的所有工作,我开始怀疑这是否值得;)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM