Updating old statistics?

We bought a consultant's third-party process that measured aspects of our unit tests, so that management could make pretty reports.  We incorporated it into our TeamCity builds.

That process failed about 6 months back, and no one noticed.  Instead of indicating failure, the process simply repeated the previous run's statistics.

Now management wants to IPO.  And they want to show people our soaring progress in unit tests.  Except our statistics indicate we haven't changed in 6 months.

So now management wants me to get those statistics updated, manually checking out the code for each checkin of the last 6 months, running the third-party tool, and updating the statistics.  And, of course, they want it yesterday.

I can't find a teamcity-info.xml file anywhere on the build server.  However, looking at the logs, it appears this code writes '##teamcity[buildStatisticValue' messages each time it runs.

Could you tell me how I can update the statistics?  What files need to be updated?  How do I remove the old statistic, and replace it with the new?

Comment actions Permalink

Hi Kilo,

Do I correctly understand that you want to rerun builds on changes for some time? If yes, that it is not possible at the moment to rerun the build with all its settings, please vote for https://youtrack.jetbrains.com/issue/TW-5946.
However you can run the build on a specified change via REST API.
Also using these REST API requests you can get the build statistics. Is it what you need?

Comment actions Permalink


Thank you for the pointers.  However, I'm still missing the key ingredient:  how to update the statistics from the previous builds.

Say on Jan 1, I ran build # 456 on build configuration XYZ.  One step of that build was to run a consultant's package, which generated some statistics.

It's now April 29.  Management can look at the statistics for the month of January, and see some fancy statistics for our unit tests (coverage, coverage vs complexity, unit tests as percentage of code checked in, etc).  But those numbers are wrong.

What they want me to do is rerun build #456, re-generate the statistics using the consultant's package, and replace the bad numbers with good numbers.  I can rerun the build outside of TeamCity, and I can re-generate the statistics outside of TeamCity, and get good numbers.  What I don't know is how to replace the wrong numbers with right ones.  I suspect they're stored in MySQL somewhere, but I don't know where.

Does that help?

Comment actions Permalink


Yes, the statistic results are stored in the database. It is strongly not recommended to modify TeamCity SQL database in any way but TeamCity and also there is no easy way to perform it. So unfortunately there is no way to solve this problem in the way you want.


Please sign in to leave a comment.