问题:对于此拉取请求,测试不会通过CircleCI,但是测试会在本地通过。为什么?
该CircleCI测试输出显示了所有失败FBSnapshotTestCase
的测试。例如:
✗testAdjustsFontSizeToFitWidth,(((comparisonSuccess__)为真)失败-快照比较失败:错误域= FBSnapshotTestControllerErrorDomain代码= 1“无法加载参考图像。” UserInfo = 0x7f85f36b0a50 {NSLocalizedFailureReason =找不到参考图片。您需要在记录模式下运行测试,NSLocalizedDescription =无法加载参考图像。
[…]
✗testAttributedTruncationToken,(((comparisonSuccess__)为真)失败-快照比较失败:错误域= FBSnapshotTestControllerErrorDomain代码= 1“无法加载参考图像。” UserInfo = 0x7f85f35b06d0 {NSLocalizedFailureReason =找不到参考图片。您需要在记录模式下运行测试,NSLocalizedDescription =无法加载参考图像。
但是,相同的测试会在本地通过:
在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
FBSnapshotTestCase
问题您是否尝试过在没有缓存的情况下运行构建?这通常为我解决了这类问题。要构建无缓存,只需单击右上角的按钮。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句