Test metrics

I've been exploring test metadata to record numeric information (in this case, duration of a part of an e2e test):

##teamcity[testMetadata testName='path/to/script.js' name='Name Of Test Section' type='number' value='549' flowId='jvm_m8y3av6a']

This is copied from the verbose build log, but I cannot see this data anywhere. I've looked in a build's params and reported stats. Artifacts. Test history.

The docs give examples showing it appearing when there's an error. I need it always. I want to be able to see individual values, and chart it, and fail on metric change.

The custom metrics say about using service messages, but there's nothing in the service msg docs about custom metrics. Do they mean the above? Must “Name Of Test Section” above be a globally unique metric identifier, perhaps? What am I missing?

0
1 comment

Hi Steve,

Please ensure that the testName used in your service message is correct. You can refer to the official documentation on interpreting test names.
Additionally, you can download the test results as a CSV file — the testName will also appear there, which can help verify if the metadata is being attached correctly.


In the Tests tab of a build, you can also set an attachment icon to indicate additional data, and in some cases, you can view custom metric graphs for individual tests. For more details, please refer to the following documentation: Reporting Test Metadata – TeamCity Docs


If this doesn’t cover your case, please feel free to let me know — I’ll be happy to assist further.

Best Regards,
Tom

0

Please sign in to leave a comment.