codacy / codacy-coverage-reporter

Multi-language coverage reporter for Codacy
https://www.codacy.com
Other
135 stars 94 forks source link

[CY-2530] SimpleCov support #155

Closed aaronmallen closed 1 year ago

aaronmallen commented 4 years ago

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.

mrfyda commented 4 years ago

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

aaronmallen commented 4 years ago

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

github-actions[bot] commented 4 years ago

Internal ticket created : CY-2530

GURVARINDER commented 4 years ago

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

aaronmallen commented 4 years ago

@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
lolgab commented 4 years ago

@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 commented 4 years ago

@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.

GURVARINDER commented 4 years ago

Thanks for the update @lolgab

bmulholland commented 3 years ago

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

stefanvacareanu7 commented 1 year ago

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