TeamCity 测试选项卡不会出现在自定义测试框架中 [英] TeamCity tests tab won't show up for custom testing framework

查看:30
本文介绍了TeamCity 测试选项卡不会出现在自定义测试框架中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

许多类似的问题已经存在,但都针对特定的测试框架,例如 PHP 或 Junit.我想使用自定义框架显示测试选项卡,该框架利用

Many similar questions already exist but all address specific testing frameworks such as PHP or Junit. I would like to get the tests tab to appear using a custom framework that makes use of service messages along the lines of

##teamcity[testSuiteStarted name = 'Benchmark.Tests'] 

做它的工作.我是否仍然需要处理 XML 报告来执行此操作,还是有更简单的方法?我的测试"只是从测试目录中检出,每个目录都包含测试子目录和每个测试的小 python 脚本.脚本输出服务消息以指示测试是成功还是失败.

To do its work. Do I still need XML report processing to do this or is there an easier way? My 'tests' are simply checked out of a testing directory, each containing test subdirectories and a little python script for each test. The script outputs service messages to indicate whether the test has succeeded or failed.

如何让测试标签显示这种设置?

How do I get the tests tab to show up for this kind of setup?

推荐答案

对于那些遇到此问题的人.我就是这样解决的

For those of you that encounter this problem. This is how I fixed it

服务消息不是开玩笑,它们确实会显示测试选项卡,但为此需要以下顺序:

The service messages are no joke, they do get the test tab to show up, but for this the following order is needed:

##teamcity[testSuiteStarted name = 'tests'] 
##teamcity[testStarted name='tests.test1']
##teamcity[testFailed name ='tests.test1' message = 'error'] ---->> OPTIONAL!!!!
##teamcity[testFinished name ='tests.test1']
##teamcity[testSuiteFinished name = 'tests'] 

请注意,第三条服务消息是可选,而所有其他消息都是必需.第三条服务消息应该只出现在失败的测试中.对于成功的测试,只应出现三个服务消息(即 testSuiteStarted、testStarted、testFinished 和 testSuiteFinished).

Please note that the third service message is OPTIONAL whereas all the others are REQUIRED. The third service message should only show up for failed tests. For successful tests only three services messages should occur (ie testSuiteStarted, testStarted, testFinished and testSuiteFinished).

TeamCity 文档中,他们真的应该使这更清楚.他们提供了大量可能的服务消息,而没有真正指定哪些是必需的,哪些是可选的......

In the TeamCity documentation they should really make this a lot clearer. They are presenting a huge list of possible service messages without really specifying which are required and which are optional...

这篇关于TeamCity 测试选项卡不会出现在自定义测试框架中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆