Skip to content

Commit fd6aadd

Browse files
authored
Merge pull request #99 from NYULibraries/test-reporter
add test coverage reporter
2 parents e705436 + 820403a commit fd6aadd

File tree

5 files changed

+42
-2
lines changed

5 files changed

+42
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@
3535

3636
# Ingore mac junk
3737
.DS_Store
38+
39+
# Ignore test coverage
40+
/coverage

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@ addons:
66
firefox: latest
77
global_env:
88
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
9+
- CC_TEST_REPORTER_ID=f0d2e58efd0ddc833f4ffae5c34ce3f034ba4b425bea0f0902952c907156cbba
910
before_install:
1011
- gem update --system
1112
- gem install bundler
13+
before_script:
14+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
15+
- chmod +x ./cc-test-reporter
16+
- ./cc-test-reporter before-build
1217
script:
1318
- cp config/vars.yml.example config/vars.yml
1419
- bundle exec rake db:schema:load
1520
- bundle exec rake ci
21+
after_script:
22+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ group :development, :test do
3131
gem 'geckodriver-helper'
3232
gem 'puma'
3333
gem 'rspec-rails'
34+
gem 'rubocop'
3435
gem 'selenium-webdriver'
36+
gem 'simplecov'
3537
gem 'spring'
3638
gem 'web-console'
3739
end

Gemfile.lock

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ GEM
5555
archive-zip (0.12.0)
5656
io-like (~> 0.3.0)
5757
arel (9.0.0)
58+
ast (2.4.0)
5859
autoprefixer-rails (9.7.4)
5960
execjs
6061
bcrypt (3.1.13)
@@ -103,6 +104,7 @@ GEM
103104
responders
104105
warden (~> 1.2.3)
105106
diff-lcs (1.3)
107+
docile (1.3.2)
106108
dry-configurable (0.9.0)
107109
concurrent-ruby (~> 1.0)
108110
dry-core (~> 0.4, >= 0.4.7)
@@ -193,12 +195,14 @@ GEM
193195
i18n (1.8.2)
194196
concurrent-ruby (~> 1.0)
195197
io-like (0.3.0)
198+
jaro_winkler (1.5.4)
196199
jbuilder (2.9.1)
197200
activesupport (>= 4.2.0)
198201
jquery-rails (4.3.5)
199202
rails-dom-testing (>= 1, < 3)
200203
railties (>= 4.2.0)
201204
thor (>= 0.14, < 2.0)
205+
json (2.3.0)
202206
json-schema (2.8.1)
203207
addressable (>= 2.4)
204208
jwt (2.2.1)
@@ -258,6 +262,9 @@ GEM
258262
oauth2 (~> 1.0)
259263
omniauth (~> 1.2)
260264
orm_adapter (0.5.0)
265+
parallel (1.19.1)
266+
parser (2.7.0.2)
267+
ast (~> 2.4.0)
261268
public_suffix (4.0.3)
262269
puma (4.3.1)
263270
nio4r (~> 2.0)
@@ -288,6 +295,7 @@ GEM
288295
method_source
289296
rake (>= 0.8.7)
290297
thor (>= 0.19.0, < 2.0)
298+
rainbow (3.0.0)
291299
rake (10.5.0)
292300
rdoc (6.2.1)
293301
regexp_parser (1.6.0)
@@ -315,6 +323,13 @@ GEM
315323
rspec-mocks (~> 3.9.0)
316324
rspec-support (~> 3.9.0)
317325
rspec-support (3.9.2)
326+
rubocop (0.79.0)
327+
jaro_winkler (~> 1.5.1)
328+
parallel (~> 1.10)
329+
parser (>= 2.7.0.1)
330+
rainbow (>= 2.2.2, < 4.0)
331+
ruby-progressbar (~> 1.7)
332+
unicode-display_width (>= 1.4.0, < 1.7)
318333
ruby-progressbar (1.10.1)
319334
rubyzip (2.0.0)
320335
sanitize (5.1.0)
@@ -336,6 +351,11 @@ GEM
336351
selenium-webdriver (3.142.7)
337352
childprocess (>= 0.5, < 4.0)
338353
rubyzip (>= 1.2.2)
354+
simplecov (0.17.1)
355+
docile (~> 1.1)
356+
json (>= 1.8, < 3)
357+
simplecov-html (~> 0.10.0)
358+
simplecov-html (0.10.2)
339359
solr_wrapper (2.1.0)
340360
faraday
341361
retriable
@@ -364,6 +384,7 @@ GEM
364384
thread_safe (~> 0.1)
365385
uglifier (4.2.0)
366386
execjs (>= 0.3.0, < 3)
387+
unicode-display_width (1.6.1)
367388
warden (1.2.8)
368389
rack (>= 2.0.6)
369390
web-console (3.7.0)
@@ -399,9 +420,11 @@ DEPENDENCIES
399420
rails
400421
rsolr
401422
rspec-rails
423+
rubocop
402424
sass-rails
403425
sdoc
404426
selenium-webdriver
427+
simplecov
405428
solr_wrapper
406429
spring
407430
sqlite3

spec/spec_helper.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@
22
ENV['RAILS_ENV'] ||= 'test'
33

44
require File.expand_path('../../config/environment', __FILE__)
5-
require 'rspec/rails'
65
require 'capybara/rspec'
76
require 'capybara/rails'
87
require 'capybara-screenshot/rspec'
9-
require 'selenium-webdriver'
108
require 'devise'
119
require 'factory_bot'
10+
require 'rspec/rails'
11+
require 'selenium-webdriver'
12+
require 'simplecov'
13+
14+
SimpleCov.start do
15+
add_filter 'spec'
16+
end
1217

1318
Capybara.register_driver :firefox_headless do |app|
1419
options = ::Selenium::WebDriver::Firefox::Options.new

0 commit comments

Comments
 (0)