New in TeamCity 2018.2: Metadata in Tests

Ever since TeamCity 2018.2, a test run in TeamCity can be associated with some supplementary information (metadata), in addition to a test’s status, execution time, and output. This information can be used to provide things like extra logs, screenshots, numeric values, and tags.

You can now use service messages to report this kind of additional test data in TeamCity and then view it using the TeamCity Web UI. Consult the corresponding documentation for details.

On GitHub, you can find a sample project that demonstrates the use of metadata with tests. In TeamCity, create a project from the URL using this GitHub repository, and then run the build. Once the build completes, on the Tests tab, next to the test name, you will notice a paperclip icon indicating that the test results include additional metadata.

TeamCity-test-medatada

By clicking the icon, you will open a popup displaying the attached metadata. The same information is presented on the build overview screen. Notice that a numeric value renders a 2D-graph from the historical results.

TeamCity-test-metadata-overview

In the demo project, see CodeTest.kt for the examples of the metadata reporting code.

About Anton Arhipov

Developer Advocate at JetBrains
This entry was posted in Blogroll, Features, Tips&Tricks. Bookmark the permalink.

5 Responses to New in TeamCity 2018.2: Metadata in Tests

  1. Great feature, but I can’t make it work.
    Could you please create a demo project for C#?

  2. Kirill Maximov says:

    Hello Oleg,

    Unfortunately, we don’t have such a project at hand. To diagnose the issue, take a look at the build log warnings, TeamCity should warn you if it notices incorrectly formed service messages. Most likely issue is a wrong reporting of a test name in the service message if you report metadata after the test end.

    Hope this helps,

  3. Darren Collins says:

    Hah, was looking for a “staple icon” in the image and couldn’t see it, thought I was going crazy, and then realised you were talking about the paperclip icon :-).

Comments are closed.