4

我们最近设置了一些带有 iOS 应用程序的Xcode 机器人来自动构建和测试我正在开发的应用程序。如果我只是构建和分析,构建过程可以正常工作。如果我将它设置为运行测试,它最终会出现大量以Unexpected TestSuiteWillFinish. 例如,最近的运行显示:

运行测试套件 TimeClockTestCase 遇到错误(Unexpected TestCaseDidFinish) testParseResponseString 遇到错误(Unexpected TestSuiteWillFinish) testGetIntegrationID 遇到错误(Unexpected TestSuiteWillFinish)

而之前的只有一个错误:

testAddChildObjectTypeTimeClockEvent 遇到错误 (Unexpected TestSuiteWillFinish)

集成结果显示所有测试都已通过,无论显示什么错误。如果我直接通过 Xcode 运行测试(而不是在服务器上运行机器人),则没有错误并且通过了相同数量的测试。

是什么导致了这些错误,我该如何消除它们?


以下是 TimeClockTestCase 的日志:

Test Suite 'TimeClockTestCase' started at 2014-02-23 23:11:09 +0000
2014-02-23 18:11:09.653 -0500 [TimeClockResponseCommand parseResponseString] [Line 74] W: Unsupported action number "3" in TIMECLOCK response command

Test Case '-[TimeClockTestCase testAddChildObjectTypeTimeClockEvent]' started.
Test Case '-[TimeClockTestCase testAddChildObjectTypeTimeClockEvent]' passed (0.000 seconds).
Test Case '-[TimeClockTestCase testAddChildObjectTypeTimeClockMode]' started.
Test Case '-[TimeClockTestCase testAddChildObjectTypeTimeClockMode]' passed (0.000 seconds).
Test Case '-[TimeClockTestCase testTimeclockEventColl]' started.
Test Case '-[TimeClockTestCase testTimeclockEventColl]' passed (0.000 seconds).
Test Case '-[TimeClockTestCase testTimeclockModeColl]' started.
Test Case '-[TimeClockTestCase testTimeclockModeColl]' passed (0.000 seconds).
Test Suite 'TimeClockTestCase' finished at 2014-02-23 23:11:09 +0000.
4

2 回答 2

5

I got the same random behavior. I was able to identify that I was making an Asynchronous call, and testing it, was what caused this random Unexpected TestSuiteWillFinish.

As I'm using Kiwi, what I did is to wait a little bit the end of the asynchronous call like indicated here (https://github.com/allending/Kiwi/wiki/Asynchronous-Testing) for those specicfic asynchronous calls.

Hope this help!

于 2014-03-10T16:51:10.127 回答
0

我们遇到了同样的Unexpected TestSuiteWillFinish调用导致测试中止的问题。在我们的例子中,这是由于过多的调试日志记录造成的。禁用我们的日志记录会导致测试再次可靠地通过。

这似乎不是您的问题的原因,但也许这是一个提示?

我的临时猜测是 XCTest 跑步者有某种超时。那么检查您的测试是否及时执行?

于 2014-05-29T17:54:31.607 回答