Skip to content
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

SimpleCov support #11

Open
ghost opened this issue Apr 15, 2012 · 9 comments
Open

SimpleCov support #11

ghost opened this issue Apr 15, 2012 · 9 comments

Comments

@ghost
Copy link

ghost commented Apr 15, 2012

RCov does not work on Ruby 1.9. SimpleCov is Ruby 1.9's code coverage tool. Add support for SimpleCov

@martin-naumann
Copy link

+1

1 similar comment
@simonoff
Copy link

+1

@bf4
Copy link

bf4 commented Aug 20, 2013

PR? or just R?

@pekkama
Copy link

pekkama commented Jun 20, 2014

+1

@bf4
Copy link

bf4 commented Jun 22, 2014

I don't even understand what this ticket means. Just run simplecov along with your suite and use the HTML publisher plugin. It should be closed.

@skord
Copy link

skord commented Sep 22, 2014

@bf4 Why? Because of health concerns:

selection_023

It's much easier to take a look at that than go look at a bunch of reports somewhere else.

Here's the exception if it matters:

Publishing rcov report...
ERROR: Publisher hudson.plugins.rubyMetrics.rcov.RcovPublisher aborted due to exception
hudson.util.IOException2: cannot parse rcov report file
    at hudson.plugins.rubyMetrics.rcov.RcovParser.parse(RcovParser.java:61)
    at hudson.plugins.rubyMetrics.rcov.RcovParser.parse(RcovParser.java:34)
    at hudson.plugins.rubyMetrics.rcov.RcovPublisher.perform(RcovPublisher.java:51)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
    at hudson.model.Build$BuildExecution.post2(Build.java:183)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
    at hudson.model.Run.execute(Run.java:1770)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:89)
    at hudson.model.Executor.run(Executor.java:240)
Caused by: org.htmlparser.util.ParserException: cannot parse rcov report file, report element wasn't found
    at hudson.plugins.rubyMetrics.rcov.RcovParser.getReportTable(RcovParser.java:71)
    at hudson.plugins.rubyMetrics.rcov.RcovParser.parse(RcovParser.java:42)
    ... 11 more
Notifying upstream projects of job completion

@skord
Copy link

skord commented Sep 22, 2014

Update, it looks like the following makes this work:

require 'simplecov'
require 'simplecov-rcov'
SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
SimpleCov.start 'rails'

@nicocesar
Copy link

@skord any idea if this was updated upstream?

@Unknown-Guy
Copy link

Unknown-Guy commented Aug 3, 2016

Was fighting with this today also. The coverage/index.html generated by SimpleCov::Formatter::HTMLFormatter from simplecov does not have the format https://github.com/jenkinsci/rubymetrics-plugin/blob/master/src/main/java/hudson/plugins/rubyMetrics/rcov/RcovParser.java expects. The simplecov-rcov gem providesSimpleCov::Formatter::RcovFormatter which generates the expected format in the coverage/rcov/index.html

That's why it works like @skord posted.

So to support SimpleCov this plugin should read .last_run.json. Think it only provides total code coverage though and not total coverage. At least that's my understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants