如果项目中有测试用例,Jenkins构建会因Xcode而失败

问题描述 投票:0回答:1

'Module was not compiled for testing' when using @testable无法解决此问题。


我正在使用jenkins和fastlane将Xcode项目与CI / CD集成。如果项目没有测试用例,则我的Xcode项目构建成功。如果我添加测试用例,则xcode构建在jenkins中失败,并显示错误:

错误:未编译模块'JenkinsFastlaneExample'以进行测试

错误屏幕截图

enter image description here


在一篇帖子中,我发现answer设置方案标志,我做出了类似答复,但对我不起作用。

enter image description here

enter image description here


我的测试用例在Xcode 11.x和iOS 13.x中也成功。在iPhone XR中测试]

enter image description here


我无法找出为什么詹金斯构建失败的原因。

Demo Repo(如果需要): https://github.com/thedahiyaboy/ios_jenkins_example


编辑:

[我也试图从Xcode禁用我的测试用例,以便我只能从mac系统运行我的用例,希望jenkins跳过测试包,但遇到相同的问题。

ios xcode jenkins continuous-integration fastlane
1个回答
0
投票

在jenkins中,配置是Release(默认情况下),我没有注意到,将其替换为Debug后,我的构建成功了。

参考图像:

enter image description here

参考文档:

https://plugins.jenkins.io/xcode-plugin/


特别感谢Scriptable为解决该问题付出了时间和精力。

© www.soinside.com 2019 - 2024. All rights reserved.