Skip to content

Commit

Permalink
Do not gather coverage on JRuby
Browse files Browse the repository at this point in the history
There are two reasons for this:
- Coverage is inaccurate unless running in debug mode
- Simplecov breaks on JRuby 1.7 in 1.8 mode
  • Loading branch information
mvz committed May 12, 2019
1 parent 0793138 commit e4539cf
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -70,7 +70,7 @@ group :development, :test do
end

# Code Coverage
gem 'simplecov', '~> 0.10'
gem 'simplecov', '~> 0.10' unless RUBY_PLATFORM.include?('java')

# Test api
gem 'rspec', '~> 3.4'
Expand Down
2 changes: 1 addition & 1 deletion features/support/env.rb
@@ -1,7 +1,7 @@
$LOAD_PATH.unshift File.expand_path('../../../lib', __FILE__)

# Has to be the first file required so that all other files show coverage information
require 'simplecov'
require 'simplecov' unless RUBY_PLATFORM.include?('java')

# Standard Library
require 'fileutils'
Expand Down
15 changes: 9 additions & 6 deletions features/support/simplecov_setup.rb
@@ -1,8 +1,11 @@
# @note this file is loaded in env.rb to setup simplecov using RUBYOPTs for child processes and @in-process
require 'simplecov'
# @note this file is loaded in env.rb to setup simplecov using RUBYOPTs for
# child processes and @in-process
unless RUBY_PLATFORM.include?('java')
require 'simplecov'

root = File.expand_path('../../../', __FILE__)
root = File.expand_path('../../../', __FILE__)

SimpleCov.command_name(ENV['SIMPLECOV_COMMAND_NAME'])
SimpleCov.root(root)
load File.join(root, '.simplecov')
SimpleCov.command_name(ENV['SIMPLECOV_COMMAND_NAME'])
SimpleCov.root(root)
load File.join(root, '.simplecov')
end
1 change: 1 addition & 0 deletions spec/aruba/api_spec.rb
@@ -1,6 +1,7 @@
require 'spec_helper'
require 'aruba/api'
require 'fileutils'
require 'time'

describe Aruba::Api do
include_context 'uses aruba API'
Expand Down
8 changes: 5 additions & 3 deletions spec/spec_helper.rb
Expand Up @@ -2,9 +2,11 @@

$LOAD_PATH << ::File.expand_path('../../lib', __FILE__)

require 'simplecov'
SimpleCov.command_name 'rspec'
SimpleCov.start
unless RUBY_PLATFORM.include?('java')
require 'simplecov'
SimpleCov.command_name 'rspec'
SimpleCov.start
end

# Pull in all of the gems including those in the `test` group
require 'bundler'
Expand Down

0 comments on commit e4539cf

Please sign in to comment.