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

耗尽温柔 提交于 2019-12-11 16:55:45

问题


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'] 

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?


回答1:


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).

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...



来源:https://stackoverflow.com/questions/46810424/teamcity-tests-tab-wont-show-up-for-custom-testing-framework

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!