{"id":12762,"date":"2019-01-15T09:55:17","date_gmt":"2019-01-15T09:55:17","guid":{"rendered":"https:\/\/blog.jetbrains.com\/teamcity\/?p=6919"},"modified":"2019-09-15T20:26:10","modified_gmt":"2019-09-15T20:26:10","slug":"new-in-teamcity-2018-2-metadata-in-tests","status":"publish","type":"teamcity","link":"https:\/\/blog.jetbrains.com\/fr\/teamcity\/2019\/01\/new-in-teamcity-2018-2-metadata-in-tests","title":{"rendered":"Metadata in Tests"},"content":{"rendered":"<p>Ever since TeamCity 2018.2, a test run in TeamCity can be associated with some supplementary information (metadata), in addition to a test\u2019s status, execution time, and output. This information can be used to provide things like extra logs, screenshots, numeric values, and tags.<\/p>\n<p>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 <a href=\"https:\/\/confluence.jetbrains.com\/display\/TCD18\/Reporting+Test+Metadata\" target=\"_blank\" rel=\"noopener\">documentation<\/a> for details.<\/p>\n<p>On GitHub, you can find a <a href=\"https:\/\/github.com\/JetBrains\/teamcity-test-metadata-demo\" target=\"_blank\" rel=\"noopener\">sample project<\/a> 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.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-6920\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2019\/01\/teamcity-TeamCity-test-medatada.png\" alt=\"TeamCity-test-medatada\" width=\"1917\" height=\"680\" \/><\/p>\n<p>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.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-6921\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2019\/01\/teamcity-TeamCity-test-metadata-overview.png\" alt=\"TeamCity-test-metadata-overview\" width=\"1948\" height=\"1192\" \/><\/p>\n<p>In the demo project, see <a href=\"https:\/\/github.com\/JetBrains\/teamcity-test-metadata-demo\/blob\/master\/src\/test\/java\/foo\/CodeTest.kt\" target=\"_blank\" rel=\"noopener\">CodeTest.kt<\/a> for the examples of the metadata reporting code.<\/p>\n","protected":false},"author":820,"featured_media":0,"comment_status":"open","ping_status":"open","template":"","categories":[1584,808,601],"tags":[],"cross-post-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/teamcity\/12762"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/teamcity"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/types\/teamcity"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/users\/820"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/comments?post=12762"}],"version-history":[{"count":0,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/teamcity\/12762\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/media?parent=12762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/categories?post=12762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/tags?post=12762"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/cross-post-tag?post=12762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}