Skip to content

Commit 3828d23

Browse files
committed
Run coverage just once
1 parent 6a11a71 commit 3828d23

File tree

3 files changed

+24
-20
lines changed

3 files changed

+24
-20
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ branches:
2929

3030
matrix:
3131
include:
32+
- rvm: 2.3.1
33+
jdk: oraclejdk8
34+
env: COVERAGE=1
3235
- rvm: jruby-head
3336
jdk: oraclejdk8
3437
env: TRUFFLE=1

Gemfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ end
2020
group :testing do
2121
gem 'rspec', '~> 3.3.0'
2222
gem 'timecop', '~> 0.7.4'
23+
end
2324

24-
# Coverage
25-
gem 'simplecov', '~> 0.10.0', :require => false
26-
gem 'coveralls', '~> 0.8.2', :require => false
25+
# made opt-in since it will not install on jruby 1.7
26+
if ENV['COVERAGE']
27+
group :coverage do
28+
gem 'simplecov', '~> 0.10.0', :require => false
29+
gem 'coveralls', '~> 0.8.2', :require => false
30+
end
2731
end
2832

2933
group :benchmarks do

spec/spec_helper.rb

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
$VERBOSE = nil # suppress our deprecation warnings
22

3-
# we can't use our helpers here because we need to load the gem _after_ simplecov
4-
unless RUBY_ENGINE == 'jruby' && 0 == (JRUBY_VERSION =~ /^9\.0\.0\.0/)
5-
if (ENV['COVERAGE'] || ENV['CI'] || ENV['TRAVIS']) && !ENV['NO_COVERAGE']
6-
require 'simplecov'
7-
require 'coveralls'
3+
if ENV['COVERAGE']
4+
require 'simplecov'
5+
require 'coveralls'
86

9-
if ENV['TRAVIS']
10-
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
7+
if ENV['TRAVIS']
8+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
119
SimpleCov::Formatter::HTMLFormatter,
1210
Coveralls::SimpleCov::Formatter
13-
]
14-
else
15-
SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
16-
end
11+
]
12+
else
13+
SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
14+
end
1715

18-
SimpleCov.start do
19-
project_name 'concurrent-ruby'
20-
add_filter '/build-tests/'
21-
add_filter '/examples/'
22-
add_filter '/spec/'
23-
end
16+
SimpleCov.start do
17+
project_name 'concurrent-ruby'
18+
add_filter '/build-tests/'
19+
add_filter '/examples/'
20+
add_filter '/spec/'
2421
end
2522
end
2623

0 commit comments

Comments
 (0)