How setup email notification when unit tests fail

I have a big project. And I want to receive email when I (and  only I) commit code which broke unit test. We have TeamCity project  which run all unit tests (it takes more than 5 hours). And I have 2  problems to setup it:

  1. Project has already broken tests (these tests will be fixed but  not now). And I want receive email only when I broke new tests. And I  don't want receive email when fail old tests.

  2. To check all tests take a lot of time (near 5-6 hours). For this  time many developers commit changes. So when team city run unit tests,  there are more then 30 changes (and more than 30 different developers  can make this changes). And only 1 developer broke test, and I want that  only this 1 developer receive email but not all 30.

How can I do that? If someone have some idea or advice, I will be very appreciate.  Thank you very much for help.

2 comments
Comment actions Permalink

Regarding #2 - you are assuming it can be easily determined which commit caused the build to fail.
This will not always be the case.

If 30 developers each commits code changes, and the next build fails, all of them will receive messages, since a build with their changes was failing. TeamCity cannot assume which one of those changes caused the failure.

Another way is to launch (suppose you have the infrastructure and resources for that) -- 30 different "personal builds" - each containing ONLY a single developer's changes.
This will also probably not work since some combination of changes can cause the build to fail, this method will not find these issues (maybe that's what you want?)

In general, i don't think this can be achieved.

It'd be nice to hear other people's view on this though.

Regards,
Lior

0
Comment actions Permalink

Another way is to launch (suppose you have the infrastructure and resources for that) -- 30 different "personal builds" - each containing ONLY a single developer's changes.
This will also probably not work since some combination of changes can cause the build to fail, this method will not find these issues (maybe that's what you want?)

Unfortunately to check all tests take near 5-6 hours, and 30 personal builds can be too much. But I'll try, if I don't find easier way. Thank you very much.

0

Please sign in to leave a comment.