• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ios - 测试在 Xcode 中通过,但在 Circle CI 中失败

[复制链接]
菜鸟教程小白 发表于 2022-12-12 16:14:14 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

问题:对于this pull request ,测试没有通过 CircleCI,但测试在本地通过。为什么?


CircleCI test output显示所有 FBSnapshotTestCase 测试的失败。例如:

✗ testAdjustsFontSizeToFitWidth, ((comparisonSuccess__) is true) failed - Snapshot comparison failed: Error Domain=FBSnapshotTestControllerErrorDomain Code=1 "Unable to load reference image." UserInfo=0x7f85f36b0a50 {NSLocalizedFailureReason=Reference image not found. You need to run the test in record mode, NSLocalizedDescription=Unable to load reference image., FBReferenceImageFilePathKey=/Users/distiller/TTTAttributedLabel/Example/TTTAttributedLabelTests/ReferenceImages_32/TTTAttributedLabelTests/[email protected]}

[…]

✗ testAttributedTruncationToken, ((comparisonSuccess__) is true) failed - Snapshot comparison failed: Error Domain=FBSnapshotTestControllerErrorDomain Code=1 "Unable to load reference image." UserInfo=0x7f85f35b06d0 {NSLocalizedFailureReason=Reference image not found. You need to run the test in record mode, NSLocalizedDescription=Unable to load reference image., FBReferenceImageFilePathKey=/Users/distiller/TTTAttributedLabel/Example/TTTAttributedLabelTests/ReferenceImages_32/TTTAttributedLabelTests/[email protected]}

但是,相同的测试在本地通过:

image

在 CircleCI 上,测试使用不存在的 ReferenceImages_32 目录:

/Users/distiller/TTTAttributedLabel/Example/TTTAttributedLabelTests/ReferenceImages_32/TTTAttributedLabelTests/[email protected]

但是,图像确实存在于 ReferenceImages_64 中。我希望使用 _64 目录,因为 circle.yml 文件指定使用 iPhone 6 模拟器:

dependencies:
  pre:
    - xcrun instruments -w "iPhone 6 (8.3 Simulator)" || exit 0
  override:    
    - sudo gem install cocoapods xcpretty obcd -N
    - pod install --project-directory=Example
test:
  override:
    - set -o pipefail && xcodebuild -workspace 'Example/Espressos.xcworkspace' -scheme 'Espressos'
      -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone 6"
      GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES clean test | xcpretty -c
      --report junit --output ${CIRCLE_TEST_REPORTS}/junit.xml



Best Answer-推荐答案


您是否尝试过在没有缓存的情况下运行构建?这通常可以为我解决这些问题。要构建无缓存,只需单击右上角的按钮。

关于ios - 测试在 Xcode 中通过,但在 Circle CI 中失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32414627/

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap