用于 Jacoco 覆盖率的 Gitlab 正则表达式
Gitlab Regex for Jacoco Coverage
Gitlab 允许 set a regular expression for parsing the coverage from CI jobs。我们使用 Jacoco,它的输出如下:
[info] ------- Jacoco Coverage Report --------
[info]
[info] Lines: 40.38% (>= required 40.0%) covered, 2265 of 3799 missed, OK
[info] Instructions: 41.99% (>= required 40.0%) covered, 10727 of 18493 missed, OK
[info] Branches: 27.79% (>= required 20.0%) covered, 738 of 1022 missed, OK
[info] Methods: 47.16% (>= required 40.0%) covered, 344 of 651 missed, OK
[info] Complexity: 34.74% (>= required 30.0%) covered, 759 of 1163 missed, OK
[info] Class: 58.82% (>= required 50.0%) covered, 49 of 119 missed, OK
Using Rubular,正则表达式 Lines:\s(\d+\.\d+%)\s\([^)]+\)\scovered
似乎适用于行覆盖。
不幸的是,它不能在 Gitlab 中工作?
它确实有效。
我使用 "retry job" 按钮测试了不同的设置, 不起作用。我假设 Gitlab 记得旧作业的设置。
作为参考,您也可以set the regex per job in the YAML file。我让它工作,然后恢复了更改,此时我意识到设置正则表达式仍然适用。
Gitlab 允许 set a regular expression for parsing the coverage from CI jobs。我们使用 Jacoco,它的输出如下:
[info] ------- Jacoco Coverage Report --------
[info]
[info] Lines: 40.38% (>= required 40.0%) covered, 2265 of 3799 missed, OK
[info] Instructions: 41.99% (>= required 40.0%) covered, 10727 of 18493 missed, OK
[info] Branches: 27.79% (>= required 20.0%) covered, 738 of 1022 missed, OK
[info] Methods: 47.16% (>= required 40.0%) covered, 344 of 651 missed, OK
[info] Complexity: 34.74% (>= required 30.0%) covered, 759 of 1163 missed, OK
[info] Class: 58.82% (>= required 50.0%) covered, 49 of 119 missed, OK
Using Rubular,正则表达式 Lines:\s(\d+\.\d+%)\s\([^)]+\)\scovered
似乎适用于行覆盖。
不幸的是,它不能在 Gitlab 中工作?
它确实有效。
我使用 "retry job" 按钮测试了不同的设置, 不起作用。我假设 Gitlab 记得旧作业的设置。
作为参考,您也可以set the regex per job in the YAML file。我让它工作,然后恢复了更改,此时我意识到设置正则表达式仍然适用。