适用于Jacoco覆盖的Gitlab正则表达式

时间:2017-05-29 08:37:25

标签: ruby regex gitlab gitlab-ci

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中工作了吗?

1 个答案:

答案 0 :(得分:0)

它确实有用。

我使用“重试作业”按钮来测试不同的设置,工作。我假设Gitlab记得旧工作的设置。

作为参考,您还可以set the regex per job in the YAML file。我得到了它,然后恢复了更改,此时我意识到设置正则表达式仍然适用。