TeamCity test history analysis API

Hi folks,

I would like to automatically analyze the test history of each test in order to automatically find for example, all tests that have their running time doubled for at most X builds.

Do I have to access TeamCity's internal database? Do you provide a sort of scripting interface? If nothing like this exists, I could give it back to the community if it makes sense.


1 comment
Comment actions Permalink

Hello Moreno,

   Unfortunately, we don't have OpenAPI for the individual test history. You can access build configuration history (SBuildType.getHistory), and load individual build tests, using the following code example:

         final BuildStatistics stats = build.getBuildStatistics(new BuildStatisticsOptions(PASSED_TESTS | IGNORED_TESTS, 0));

         final List<STestRun> tests = stats.getTests(null, Order.NATURAL_ASC);

   But executing this query for deep build history may be slow if you have many tests.
   Hope, this helps,

Please sign in to leave a comment.