如何从Fastlane xcov插件在gitlab中创建用于测试覆盖率解析的表达式?

时间:2018-12-06 08:56:55

标签: xcode gitlab fastlane

我只需要允许gitlab解析我的输出coverage文件并为每个管道显示它们。有可能吗?

enter image description here

这就是我在快速通道文件中调用coverage的方式:


lane :test do
  scan(scheme: SCHEME_NAME, code_coverage: true, clean: true, output_directory: OUTPUT_PATH + 'tests', devices: ["iPhone 8 Plus"])
  coverage
end
lane :coverage do 
  xcov(
    scheme: SCHEME_NAME,
    workspace: WORKSPACE_FILE_PATH,
    json_report: true,
    markdown_report: true,
    output_directory: OUTPUT_PATH + "coverage",
    skip_slack: true,
    only_project_targets: true
  )
end

这是输出:

enter image description here

我能以某种方式指明具有覆盖率的index.html文件的路径吗?

1 个答案:

答案 0 :(得分:0)

我认为@janpio所说的是正确的,GitLab似乎只检查跟踪。我在xcov中使用fastlane,我的输出如下所示:

+-----------+----------+
| xcov Coverage Report |
+-----------+----------+
| GreatApp  | 83.50%   |
+-----------+----------+

我设法用它来解析它:

^\|\s+GreatApp\s+\|\s+(\d+.\d+\%)\s+\|$