Is it possible to setup TFS/Test Manager so that it sends out an email after a test fails?
Asked
Active
Viewed 695 times
0
-
Are you failing a build or creating a bug workitem when the test fails? – Betty Oct 19 '12 at 02:51
-
Currently, nothing happens when a test fails. We'd like to have an email sent out to the test owner, when a test fails. – tunafish24 Oct 19 '12 at 06:09
-
What kind of tests, and what is running them? eg Unit, Automated or Manual, running as part of the build or in test manager? – Betty Oct 19 '12 at 06:17
-
Automated unit tests, they run as part of the build and from test manager as well. – tunafish24 Oct 19 '12 at 15:45
-
doesn't it make more sense to send an email to the person who broke the build than the person who owns the test? – Betty Oct 20 '12 at 01:19
-
@Betty We have separate build and test systems. So if someone breaks the build they already get the notification. We want the test server to be able to notify the testers if his/her test failed as well. – tunafish24 Oct 29 '12 at 19:10
1 Answers
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 ;).

Torbjörn Bergstedt
- 3,359
- 2
- 21
- 30