Jan 12, 2008

TeamCity: immediate test failure notifications

This feature is particularly useful, if you have lengthy builds.

With most continuous integration tools, one have to wait until build is finished to get notified about test failure. TeamCity can send notification right after test failure, before build completion.

Scenario

  • Developer commits a change
  • Build is started
  • A test fails
    • Notification "Build is failing" is sent to the developer and to other subscribers via configured notifiers
    • Test failure details immediately appear in the Web UI
    • Clickable stacktrace on the Web page allows to open the test and the stacktrace in IDE
    • Developer can see if this test failed in the previous build


  • If the fix is simple, developer commits the fix even before original build has finished.
  • Optionally, developer may stop the original build to free the build agent.
  • Otherwise the original build finishes (possibly with other test failures).
  • TeamCity sends notification about build completion and its results.
According to this scenario, it may take a little time between problem detection and the fix, and the same little time the broken code will stay in the version control system. And this is a Good Thing, and I like this.

You can read more about this and other features on the official TeamCity site.

Good builds in new year,

KIR

BTW, in the previous post I described how to avoid broken code in version control at all.

2 comments:

kiran said...

KIR,

I have few questions about the "Build Script Interaction with TeamCity". Currently we have C# project and we are using msbuild as a build runner, currently we are using some 3rd part testframework, which is not supported by Teamcity.
The 3rd party testframework can able to export the test results to an xml file. Is there way to publish the test results to teamcity webpage.

I want the same appearance of the tests tab when we execute the test cases with nunit. Is it possible.

Please let me know your suggestions

Kir Maximov said...

Hello kiran,

If your reports are compatible with NUnit ones, you can use the recently released support of various XML reports in TeamCity 4.5. Please take a look at new features in TeamCity 4.5 and search for XML Reports Handling heading.

The documentation for the feature is available here. You can install this plugin to TeamCity 4.0 server as well.

Hope this helps,
KIR