Coverage capture impossible when no percent symbol is present
Summary
If the coverage reporter doesn't explicitely set the % symbol, then the coverage is ignored by gitlab which then sets it to 33%.
Steps to reproduce
Our clojure coverage reporter doesn't produce report percentage with % symbol.
We defined the following regex:
.*ALL FILES.*\|\s*([0-9]{1,2}\.{1}[0-9]{1,2}).*\|.*\|
to capture the coverage result.
Side note
The same report without percent symbol is emitted with default Jest (javascript popular test runner) coverage report:
----------------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
----------------|----------|----------|----------|----------|-------------------|
All files | 100 | 100 | 100 | 100 | |
HelloWorld.vue | 100 | 100 | 100 | 100 | |
----------------|----------|----------|----------|----------|-------------------|
What is the current bug behavior?
Gitlab seems to ignore the obtained value since it doesn't have the %
symbol. And he doesn't treat our matched number as a percent value.
In consequence, gitlab doesn't display proper coverage and fallback to a strange number of 33%.
The value of 33% occurs every time (it's not a regex mismatch, because if we gather converage only from one file with 100% coverage and with both individual and ALL FILES
100%
result, it's still 33%.
What is the expected correct behavior?
Gitlab should capture coverage percent if both number with %
symbol and number without %
symbol (in the 0 to 100 range) is matched.
Relevant screenshot
Rubular testing of our regex:
Gitlab info
GitLab 11.1.2 (35936b0)
GitLab Shell 7.1.4
GitLab Workhorse v5.0.0
GitLab API v4
Ruby 2.4.4p296
Rails 4.2.10
postgresql 9.6.8