Is there any way to get the stacktrace of failed tests using REST API?

Hi, Is there any way to get the stacktrace of failed tests using the TeamCity REST API? I know I can get test information by using

http://teamcity:8111/httpAuth/app/rest/testOccurrences?locator=build:<build locator>

but for failed tests, this does not include the stacktrace. I would like to get the stacktrace.

Thanks in advance.

Markus

2 comments
Comment actions Permalink

Hi Markus,

You can get the text shown in the web UI for a test failure, it combined test's stacktrace, stdOut and stdErr in a single message. At this time there is no ability to get stacktrace separately, let us know if you need it and detail why.

The URL you noted returns the test runs of a build. If you follow the URL from the "href" field of the failed tests, you will get all the test details in the "details" sub-element.

To get list of failed tests with adetails right away you ca use URL like:

http://teamcity:8111/httpAuth/app/rest/testOccurrences?locator=build:(<build locator>),status:FAILURE&fields=testOccurrence(id,name,status,href,details)

0
Comment actions Permalink

yaegor schrieb:

To get list of failed tests with adetails right away you ca use URL like:

http://teamcity:8111/httpAuth/app/rest/testOccurrences?locator=build:(<build locator>),status:FAILURE&fields=testOccurrence(id,name,status,href,details)


The details element is just what I need. Thanks a lot!

0

Please sign in to leave a comment.