单元测试期间Xcode CI bot错误(Unexpected TestSuiteWillFinish)

前端之家收集整理的这篇文章主要介绍了单元测试期间Xcode CI bot错误(Unexpected TestSuiteWillFinish)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我们最近设置了一个带有iOS应用程序的 Xcode bots,以自动构建和测试我正在处理的应用程序.如果我只是构建和分析,构建过程工作正常.如果我将其设置为运行测试,则最终会出现可变数量错误,这些错误以意外的TestSuiteWillFinish结尾.例如,最近一次运行显示

Run test suite TimeClockTestCase encountered an error (Unexpected
TestCaseDidFinish) testParseResponseString encountered an error
(Unexpected TestSuiteWillFinish) testGetIntegrationID encountered an
error (Unexpected TestSuiteWillFinish)

之前的那个只有一个错误

testAddChildObjectTypeTimeClockEvent encountered an error (Unexpected
TestSuiteWillFinish)

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

导致这些错误的原因是什么?如何消除它们?

这些是来自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.

解决方法

我得到了相同的随机行为.我能够确定我正在进行异步调用,并对其进行测试,这是导致这种随机的意外TestSuiteWillFinish的原因.

当我使用Kiwi时,我所做的是等待一些异步调用的结束,如此处所示(https://github.com/allending/Kiwi/wiki/Asynchronous-Testing)那些特定的异步调用.

希望这有帮助!

猜你在找的Xcode相关文章