Accessing test information through the Team City API
I'm trying to follow the instructions here to access the tests on my most recent build, but I'm having trouble getting the format right even though it should be pretty straightforward.
http://[server]/httpAuth/app/rest/builds/id:126 gets me general information about my build successfully, but http://[server]/httpAuth/app/rest/testOccurences?locator=build:id:126 throws an error.
This is the example of a build locator that I'm trying to use:
id:<internal build id>
and I've tried several variants on build/id:126, builds/id:126, etc to no avail. How should I be doing this?
Please sign in to leave a comment.
Hi,
You can find a correct link in response on getting details of a specific build, it will be in this section:
<testOccurrences count="2" href="/httpAuth/app/rest/testOccurrences?locator=build:(id:741)" passed="2"/>
There is a typo in your request, shoud be testOccurrences.
Hi Alina, thanks for catching the typo, but that still doesn't work for me. "httpAuth/app/rest/testOccurrences?locator=build:(id:182)" returns null for that uri, though "httpAuth/app/rest/builds/id:182" definitely returns build information.
Do you have <testOccurrences> section in response on "httpAuth/app/rest/builds/id:182"?
No, the only mention of the word test is in the number of tests passed and failed.
Which version of TeamCity do you use?