codacy-coverage-reporter icon indicating copy to clipboard operation
codacy-coverage-reporter copied to clipboard

[CY-2530] SimpleCov support

Open aaronmallen opened this issue 4 years ago • 9 comments

Are there any plans to add SimpleCov support? Currently the only documented supported formats are:

JaCoCo → jacoco*.xml Cobertura → cobertura.xml LCOV → lcov.info | lcov.dat | *.lcov Clover → clover.xml DotCover → dotcover.xml OpenCover → opencover.xml PHPUnit XML → coverage-xml/index.xml

Specifically I would like to see SimpleCov added as well as support for the new branch coverage features.

aaronmallen avatar Feb 18 '20 17:02 aaronmallen

hey @aaronmallen thanks for your feedback.

for the time being you can use one of SimpleCov's alternate formatters to lcov or Cobertura: https://github.com/colszowka/simplecov/blob/master/doc/alternate-formatters.md

mrfyda avatar Feb 21 '20 13:02 mrfyda

I'm actually using y'all's deprecated gem until this gets added.

aaronmallen avatar Feb 21 '20 13:02 aaronmallen

Internal ticket created : CY-2530

github-actions[bot] avatar Aug 05 '20 15:08 github-actions[bot]

@mrfyda Hi, any updates on this? I see that an internal ticket was created and was wondering if this is resolved already.

GURVARINDER avatar Sep 10 '20 19:09 GURVARINDER

@mrfyda Hi, any updates on this? I see that an internal ticket was created and was wondering if this is resolved already.

It appears to be supported now but I have to use the lcov reporter:

# Gemfile

group :test do
  gem 'simplecov', '~> 0.19'
  gem 'simplecov-lcov', '~> 0.8'
end
# spec_helper.rb

require 'simplecov'
require 'simplecov-lcov'

SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true
COVERAGE_FORMATTER = SimpleCov::Formatter::MultiFormatter.new([
                                                                SimpleCov::Formatter::HTMLFormatter,
                                                                SimpleCov::Formatter::LcovFormatter
                                                              ])

SimpleCov.start 'rails' do
  enable_coverage :branch
  formatter COVERAGE_FORMATTER
end

aaronmallen avatar Sep 10 '20 19:09 aaronmallen

@mrfyda Hi, any updates on this? I see that an internal ticket was created and was wondering if this is resolved already.

We moved our issue tracking to another internal platform. This doesn't mean, however, that this is resolved already. When we fix this, we will close this Github issue accordingly.

lolgab avatar Sep 15 '20 10:09 lolgab

@aaronmallen Thank you for the sample code. Yes, as @mrfyda wrote, until we support SimpleCov natively, a workaround is to use either the lcov or Cobertura formatters.

lolgab avatar Sep 15 '20 10:09 lolgab

Thanks for the update @lolgab

GURVARINDER avatar Sep 15 '20 18:09 GURVARINDER

When using this workaround, it seems "project name" is not set on CI, so here's the command I needed to report coverage from CircleCI: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage/lcov/project.lcov

bmulholland avatar May 12 '21 16:05 bmulholland

The team has decided to not continue with the support of SimpleCov.

stefanvacareanu7 avatar Oct 04 '23 07:10 stefanvacareanu7