简体   繁体   中英

Gitlab Regex for Jacoco Coverage

Gitlab allows to set a regular expression for parsing the coverage from CI jobs . We use Jacoco, which gives an output like this:

[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 , the regex Lines:\\s(\\d+\\.\\d+%)\\s\\([^)]+\\)\\scovered seems to work for the line coverage.

Unfortunately, it does not work in Gitlab?

It actually does work.

I used the "retry job" button to test different settings and that does not work. I assume Gitlab remembers the settings for old jobs.

For reference, you can also set the regex per job in the YAML file . I got it working with that and then reverted the change, at which point I realized the settings regex still applies.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM