Open leckylao opened 13 years ago
I'm seeing exactly the same thing with Jruby 1.6.2 and 0.9.9. I've created a example app to illustrate the problem. You can clone it here:
git clone git://github.com/tatyree/rcov_issues.git
I've included the coverage reports from my last run, which I think was cucubmer_first. I've also included screenshots of example outputs from both runs. If you don't want to clone the example, you can see them in the README:
Basically, it just doesn't seem to be aggregating the results at all. Whichever set of tests get run last are the ones the coverage report is based on.
I just checked it on 1.8.7 and it behaves as expected: 100% coverage regardless of the run order.
+1 -- I'm seeing this too.
+1 with plain ruby 1.8.7 patch 334
I cloned the repo and ran both tasks. For both runs I only get 63.6% coverage, no matter which task I use.
+1
I have the same problem with rcov and JRuby (tested 1.6.4 and 1.6.7 recently).
Some quick investigation shows the problem is with loading the aggregate data (the gzipped, marshal serialization). Attempting to load the aggregate data outside of rcov with
require 'rubygems'
gem 'rcov'
require 'rcov'
require 'zlib'
file = 'aggr.rcov'
Zlib::GzipReader.open(file) {|gz| old_data = Marshal.load(gz) }
leads to
ArgumentError: dump format error(p)
load at org/jruby/RubyMarshal.java:148
__file__ at load_aggr.rb:7
(root) at load_aggr.rb:7
As a test, I hacked the rcov script to not gzip the marshalled data, and it then works correctly.
As a temporary work-around for those that need this feature in JRuby right now (like me), I have forked version 0.9.11 of rcov and disabled gzipping of aggregate data. See the jruby_tmp branch at https://github.com/evilrich/rcov. You can use this, for example, by specifying in your Gemfile:
gem 'rcov', '0.9.11.1', :git => "git://github.com/evilrich/rcov.git", :branch => 'jruby_tmp'
When I have some more time, I intend to investigate further the problem with gzip.
Hi,
I am using jruby-1.6.1 with rcov (0.9.9 java) to run coverage report for my cucumber features and rspec tests. Everything works fine except it's not aggregating the data in the report. And there's no errors.
All the tests pass. And It's not aggregating the data as I can tell by seeing the controller get higher coverage with cucumber but later get dropped in the final report.
Here's the code. Please help.