0

是否可以设置 TFS/Test Manager 以便在测试失败后发送电子邮件?

4

1 回答 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.

  1. After tests have run, we check if BuildDetail.BuildPhaseStatus has status 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.
  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.
  4. 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 回答