REST API: Finding builds that finished but may have failed tests

Hi,
I have the following situation:

  • A particular build configuration fails when even 1 test fails
  • The build also (obviously) fails when something happens in the build process, like a compiler error.
  • For example, we will say that Build #1 was successful with all tests passed, Build #2 failed in Teamcity due to failed tests but Ant reported BUILD SUCCESSFUL, Build #3 failed due to bad code.


I am trying to gather statistics for this build configuration using the REST API.  Grabbing the Last FInished build gives me #3, which leads to NullPointerExceptions when trying to parse the stats.  The Last Successful build is #1, which is potentially stale.  Is there a set of filters that can be applied in a REST API call that will find #2:  the last build that completed, regardless of whether it may have been flagged as failing due to Failed Tests as opposed to an actual build failure?

Thanks,
Mark

0
1 comment
Avatar
Permanently deleted user
Hi Mark It is not clear which stats you are trying to collect, note that teamcity automatically collects many statistics for you (Statistics tab in the project). It seems that you need to create one job called "build" (only the compile step in your current job) and then one job called "unit tests" (with dependency on build, if successful). Then you can run your stats on "unit tests" job, which either passes or fails, but always has the statistics you want. cheers  ziv shapira
0

Please sign in to leave a comment.