-
-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cobertura XML and GitLab CI #881
Comments
Hey there, I wanted to reproduce the bug but couldn't. Looks like GitLab actually fixed this with https://docs.gitlab.com/ee/user/project/merge_requests/test_coverage_visualization.html#automatic-class-path-correction in GitLab 13.9 earlier this year. I pinged Colin O'Dell in the GitLab issue if he is still able to reproduce the bug. I can ping you here when I know more. /Flo |
Thank you, Florian. Do ping me here when you know more. |
Hi there, I know this is a quite old issue, however I just tried to get the cobertura report running with my gitlab instance. While the report was correctly generated, gitlab did not show the line coverage in merge requests using the following phpunit configuration. I think the automatic class path correction did not work as expected, so I changed to use full relative paths.
However, changing the config to the following (shortened) worked for me - however I did have to add all non-code-directories to the exclusion list:
Just in case anyone views this issue having the same problem. Would it be possible to maybe add a configuration option to the
I'd love to try if I can create a merge request - just wanted to ensure the idea is ok and there's no mistake on my side. |
It "just works" as @realFlowControl explains in https://dev.to/realflowcontrol/revisiting-gitlab-as-a-php-developer-5h9l. |
@sebastianbergmann unfortunately I just hit this same bug, because I run my tests with a "Docker in Docker" approach, so the absolute path does not match what GitLab expects, hence stopping the automatic class path correction to help me. Can we reopen this issue? [EDIT] Also, I must add that the workaround in #881 (comment) is not working for me, the Cobertura coverage is still generated with the |
@Jean85 Sure, we can reopen this issue. I cannot promise to work on this myself anytime soon, but I would review/merge any PR ASAP. |
@dhirtzbruch can you tell us how that workaround worked for you, or with which package versions? I rolled back to PHPUnit 9.4.0 and php-code-coverage 9.2.0 (the first versions to introduce cobertura support) and I still get the wrong path :( |
I think I found the issue by debugging it: it's not in the Cobertura implementation but one step before, in So, including some covered file outside |
|
Considering https://gitlab.com/gitlab-org/gitlab/-/issues/296012 and #734 (comment), would it make sense to (optionally) put the complete path into the "filename" attribute?
The text was updated successfully, but these errors were encountered: