문제

I understand that gitlab has support to Jenkins CI, but what I need is a lot less than that.

I have a Rails application and get the coverage from the tests using simplecov. It generates HTML output in a directory by running a rake task. I would like to see the current coverage through gitlab. Is there a simple way to integrate this report with gitlab?

도움이 되었습니까?

해결책 4

You now (June 2020, GitLab 13.1) have code coverage history, in addition of Test coverage parsing.

Graph code coverage changes over time for a project

All too often, a project has a code coverage target but development teams might not have much visibility into which direction that target value is trending over time.
There needs to be an easier way to track changes in code coverage over time without that extra hassle.

The Code Coverage graph now provides better visibility into how code coverage is trending over time.
It displays a simple graph of the coverage value(s) calculated in pipelines.

https://about.gitlab.com/images/13_1/code-coverage-graph.png

See Documentation and Issue


With GitLab 13.6 (November 2020), you also have (not for free though)

Display code coverage data for selected projects

In 13.4, we released the first iteration of Code Coverage data for Groups that enables you to compare the coverage of multiple projects and download the data in a single file from a single screen. However, to analyze the data, you had to open the file to check it manually, and probably imported it into a spreadsheet for further analysis. In GitLab 13.6, you can now select specific projects in a group to see their latest coverage values directly in GitLab itself without needing to download a file or waste development time accessing code coverage data. We welcome feedback on the functionality and possible iterations for this feature in our feedback issue.

https://about.gitlab.com/images/13_6/display_selected_coverage_projects_example.png -- Display code coverage data for selected projects

See Documentation and Issue.

다른 팁

I fear there is still no easy way to integrate code coverage reports but Gitlab now supports (since Version 8.0 integrated) build jobs for your code. Unfortunately you have to implement your solution by writing a custom .gitlab-ci.yml to run your coverage tests. For viewing the reports, you can specify the generated "artifacts" or publish them on gitlab pages.

For more information, see here: https://about.gitlab.com/gitlab-ci/

Additionally you can parse a text output to display a short code coverage report:

  • (Enable builds and output test coverage)
  • Go to "Project Settings" -> Builds
  • Add to "Test coverage parsing" a regular expression (examples below, simplecov included)

The short answer: Unfortunately there is no easy way to do this.

The longer answer: GitLab not yet has a Jenkins support.

What you basically need is a service like GitLab CI or Jenkins CI, which starts simplecov and posts the output back to GitLab. Unfortunately GitLab does not offer such a functionality yet.

But I know other organizations which do have a Jenkins service for GitLab which automatically comment git pushes with the Jenkins result.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top