加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-14 17:40:29 所属栏目:百科 来源:网络整理
导读:我们最近设置了一个带有iOS应用程序的 Xcode bots,以自动构建和测试我正在处理的应用程序.如果我只是构建和分析,构建过程工作正常.如果我将其设置为运行测试,则最终会出现可变数量的错误,这些错误以意外的TestSuiteWillFinish结尾.例如,最近一次运行显示: R
我们最近设置了一个带有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)那些特定的异步调用.

希望这有帮助!

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读