以下是我们面对问题时的设置方式。
问题陈述:
转到xcode12之后,jenkins管道无法生成Coverage.profdata文件,而Slather将使用该文件来派生代码覆盖率指标。是的,在运行xcode11时没有发生。
在将其指向适当的命令行工具版本(在本例中为12.4)之后,我们将使用xcodebuild命令。
首先,我们使用(在获得模拟器ID之后)构建应用程序。
xcodebuild build-for-testing -workspace Example.xcworkspace -scheme ExampleUITests -derivedDataPath ./derivedData -destination 'platform=iOS Simulator,id=<simulator_id>'然后,我们使用
xcodebuild test-without-building -workspace Example.xcworkspace -scheme ExampleUITests -enableCodeCoverage YES -destination 'platform=iOS Simulator,id=<simulator_id>' -derivedDataPath ./derivedData所有UI测试都成功运行,但在测试套件完成时,最终得到以下语句。
warning: <Path_to_derived_data>/Build/ProfileData/<Some_UUID>/<Filename>.profraw: Invalid instrumentation profile data (file header is corrupt)
error: No profiles could be merged.在我的本地机器上没有发生这种事。仅在Jenkins ec2实例中的mac上。
https://stackoverflow.com/questions/66653603
复制相似问题