简体   繁体   English

自定义测试框架不会显示TeamCity测试选项卡

[英]TeamCity tests tab won't show up for custom testing framework

Many similar questions already exist but all address specific testing frameworks such as PHP or Junit. 已经存在许多类似的问题,但是所有问题都针对特定的测试框架,例如PHP或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'] 

To do its work. 做好工作。 Do I still need XML report processing to do this or is there an easier way? 我是否仍需要XML报告处理来执行此操作,或者有更简单的方法吗? My 'tests' are simply checked out of a testing directory, each containing test subdirectories and a little python script for each test. 我的“测试”只需从测试目录中检出,每个目录都包含测试子目录和每个测试的一些python脚本。 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'] 

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). 对于成功的测试,仅应出现三个服务消息(即testSuiteStarted,testStarted,testFinished和testSuiteFinished)。

In the TeamCity documentation they should really make this a lot clearer. TeamCity文档中,他们应该使这一点更加清晰。 They are presenting a huge list of possible service messages without really specifying which are required and which are optional... 他们展示了大量可能的服务消息,而没有真正指定哪些是必需的,哪些是可选的...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM