Created
April 15, 2020 04:56
-
-
Save danmayer/c9b1558c2ba535c80c0ed238332db82d to your computer and use it in GitHub Desktop.
Jruby Coverage Differences
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
class Dog | |
def bark | |
'woof' | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is all related to trying to get Coverband to work for Jruby apps | |
# see https://github.com/danmayer/coverband/issues/361 | |
require 'coverage' | |
Coverage.start | |
require './dog.rb' | |
puts Coverage.peek_result | |
puts "done" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bundle exec ruby test/jruby_check.rb | |
{"/Users/danmayer/projects/coverband/test/dog.rb"=>[nil, nil, 1, 1, 0, nil, nil]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bundle exec ruby test/jruby_check.rb | |
test/jruby_check.rb:3: warning: tracing (e.g. set_trace_func) will not capture all events without --debug flag | |
{"/Users/danmayer/projects/coverband/test/dog.rb"=>[nil, nil, 0, 0, 0, nil, nil]} | |
> The above does not match MRI, becasue there are 0's where I would expect hits for parsing the methods... | |
bundle exec ruby --debug test/jruby_check.rb | |
{"/Users/danmayer/projects/coverband/test/dog.rb"=>[nil, nil, 1, 1, 0, nil, nil]} | |
> Now this matches, I can also get matching output with a `.jrubyrc` setting `debug.fullTrace=true` | |
ruby --version | |
jruby 9.2.9.0 (2.5.7) 2019-10-30 458ad3e OpenJDK 64-Bit Server VM 13.0.1+9 on 13.0.1+9 +jit [darwin-x86_64] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment