Statistics information is not available through REST until the end of the build

443 views Asked by At

We are building a setup that will send statistics information to the external server while building the application. There is the following build configuration with several steps.

  • 1st step builds the application and run unittests.
    • As a result a set of xml files (result of nUnit run) are created
  • 2nd step post a message Write-Host "##teamcity[importData type='nunit' path='%report.monitoring.rules%' parseOutOfDate='true' verbose='true']" to process them
  • 3rd step needs to access statistics information from the test run. Either through variables or REST api. For now it's requested using the following call Invoke-WebRequest -uri http://[host]/httpAuth/app/rest/builds/id:$buildId/statistics -Credential $creds -Headers @{"accept"="application/json"}

The problem is that inside the 3rd step I can't get statistics information even if pause is added. However, as soon as build is complete statistics appear (e.g. this line in the response <property name="TotalTestCount" value="2"/>)

The question: Is it possible to access information about test run during the build?

1

There are 1 answers

2
peinearydevelopment On

Based on their documentation, it would appear as though you can get the information you want through issuing a request to a url like the following: http://teamcity:8111/app/rest/testOccurrences?locator=build:(id:XXX),currentlyFailing:true