Skip to content

Commit 2dc5849

Browse files
authored
Merge pull request #4419 from pulibrary/coverage-in-ci-only
Only run coveralls in CI, to speed up local test runs
2 parents 1c94299 + 4f9e642 commit 2dc5849

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ group :development, :test do
114114
gem 'rubocop-rails', require: false
115115
gem 'rubocop-performance', require: false
116116
gem 'capybara'
117-
gem 'coveralls_reborn'
117+
gem 'coveralls_reborn', require: false
118118
gem "erb_lint", require: false
119119
gem "erblint-github"
120120
gem 'pry-byebug'

spec/spec_helper.rb

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
# frozen_string_literal: true
2-
require 'coveralls'
2+
def in_ci?
3+
!ENV['CI'].nil? && ENV['CI'] == 'true'
4+
end
5+
6+
require 'coveralls' if in_ci?
37
require 'factory_bot'
48
require 'webmock/rspec'
59

610
# allow connections to localhost and bibdata marc record service
711
WebMock.disable_net_connect!(allow_localhost: true,
812
allow: 'chromedriver.storage.googleapis.com')
913

10-
Coveralls.wear!('rails') do
11-
add_filter '/lib/orangelight/browse_lists.rb'
12-
add_filter '/app/models/orangelight.rb'
13-
add_filter '/lib/tasks'
14-
add_filter 'app/controllers/search_history_controller.rb'
14+
if in_ci?
15+
Coveralls.wear!('rails') do
16+
add_filter '/lib/orangelight/browse_lists.rb'
17+
add_filter '/app/models/orangelight.rb'
18+
add_filter '/lib/tasks'
19+
add_filter 'app/controllers/search_history_controller.rb'
20+
end
1521
end
1622

1723
FactoryBot.find_definitions
@@ -21,9 +27,5 @@
2127
config.example_status_persistence_file_path = "tmp/rspec_examples.txt"
2228
end
2329

24-
def in_ci?
25-
!ENV['CI'].nil? && ENV['CI'] == 'true'
26-
end
27-
2830
ENV['GRAPHQL_API_URL'] = 'https://figgy.princeton.edu/graphql' unless ENV['GRAPHQL_API_URL']
2931
ENV['FIGGY_URL'] = 'https://figgy.princeton.edu' unless ENV['FIGGY_URL']

0 commit comments

Comments
 (0)