Closed henb closed 7 years ago
Cool, this makes totally sense. And, btw, a nice feature of GitLab.
Release 1.4.12 is on hex.pm
Did you ever get this to work? Gitlab doesn't seem to do multi-line regex. So matching for the correct output doesn't work.
https://gitlab.com/gitlab-org/gitlab-ee/issues/4744
Can we change the total label to be in the same line?
@Razzeee
Did you ever get this to work?
Yes.
Gitlab doesn't seem to do multi-line regex.
You can replace the regular expression.
So matching for the correct output doesn't work.
I think you can create a PR and it will be successfully adopted.
At the time of writing the PR, gitlab did not have a default template. Right now, gitlab recommends the following:
Below are examples of regex for existing tools:
- Simplecov (Ruby) - (\d+.\d+\%) covered
- pytest-cov (Python) - \d+\%\s*$
- phpunit --coverage-text --colors=never (PHP) - ^\sLines:\s\d+.\d+\%
- gcovr (C/C++) - ^TOTAL.*\s+(\d+\%)$
- tap --coverage-report=text-summary (NodeJS) - ^Statements\s:\s([^%]+)
- excoveralls (Elixir) - [TOTAL]\s+(\d+.\d+)%
- JaCoCo (Java/Kotlin) Total.*?([0-9]{1,3})%
- go test -cover (Go) coverage: \d+.\d+% of statements
If you do not want to change the regex, just use excoveralls.
Which regex are you using?
I'm pretty confident, that you can't match for this, as you can only match for single lines. And to get a unique match, you would need to match at least two lines. Changing the regex does nothing, as you can't change that matching rule from there.
I'm, aware of the default templates, thank you :)
I can't remember why I eneded up using coverex over excoveralls, I guess I thought the other is focused on coveralls.
MOTIVATION
I want to see the report badge in my gitlab repository.
Reason
“If you use test coverage in your code, GitLab can capture its output in the build log using a regular expression. In the pipelines settings, search for the "Test coverage parsing" section.” https://gitlab.com/help/user/project/pipelines/settings#test-coverage-parsing
But coverex does not contain the totals.
Description
Calculating coverage values.
Tested
Environment:
Result
In my terminal:
In my gitlab repository:
Changes