update coverage and use coveralls.io
This commit is contained in:
parent
18c946eab1
commit
147365cba1
4 changed files with 34 additions and 7 deletions
|
@ -3,6 +3,7 @@ rvm:
|
||||||
- 1.9.3
|
- 1.9.3
|
||||||
services:
|
services:
|
||||||
- redis-server
|
- redis-server
|
||||||
|
env: COVERALLS=1
|
||||||
before_install:
|
before_install:
|
||||||
- "export DISPLAY=:99.0"
|
- "export DISPLAY=:99.0"
|
||||||
- "sh -e /etc/init.d/xvfb start"
|
- "sh -e /etc/init.d/xvfb start"
|
||||||
|
|
4
Gemfile
4
Gemfile
|
@ -84,10 +84,12 @@ group :test do
|
||||||
# webkit and poltergeist don't seem to work yet
|
# webkit and poltergeist don't seem to work yet
|
||||||
gem 'selenium-webdriver'
|
gem 'selenium-webdriver'
|
||||||
gem 'database_cleaner'
|
gem 'database_cleaner'
|
||||||
gem 'simplecov', require: false
|
|
||||||
# need to include rspec components before i18n-spec or rake fails in test environment
|
# need to include rspec components before i18n-spec or rake fails in test environment
|
||||||
gem 'rspec-core'
|
gem 'rspec-core'
|
||||||
gem 'rspec-expectations'
|
gem 'rspec-expectations'
|
||||||
gem 'rspec-rerun'
|
gem 'rspec-rerun'
|
||||||
gem 'i18n-spec'
|
gem 'i18n-spec'
|
||||||
|
# code coverage
|
||||||
|
gem 'simplecov', require: false
|
||||||
|
gem 'coveralls', require: false
|
||||||
end
|
end
|
||||||
|
|
12
Gemfile.lock
12
Gemfile.lock
|
@ -102,6 +102,12 @@ GEM
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.6.3)
|
coffee-script-source (1.6.3)
|
||||||
commonjs (0.2.7)
|
commonjs (0.2.7)
|
||||||
|
coveralls (0.7.0)
|
||||||
|
multi_json (~> 1.3)
|
||||||
|
rest-client
|
||||||
|
simplecov (>= 0.7)
|
||||||
|
term-ansicolor
|
||||||
|
thor
|
||||||
daemons (1.1.9)
|
daemons (1.1.9)
|
||||||
database_cleaner (1.2.0)
|
database_cleaner (1.2.0)
|
||||||
debug_inspector (0.0.2)
|
debug_inspector (0.0.2)
|
||||||
|
@ -248,6 +254,8 @@ GEM
|
||||||
redis-namespace (~> 1.2)
|
redis-namespace (~> 1.2)
|
||||||
sinatra (>= 0.9.2)
|
sinatra (>= 0.9.2)
|
||||||
vegas (~> 0.1.2)
|
vegas (~> 0.1.2)
|
||||||
|
rest-client (1.6.7)
|
||||||
|
mime-types (>= 1.16)
|
||||||
rspec (2.14.1)
|
rspec (2.14.1)
|
||||||
rspec-core (~> 2.14.0)
|
rspec-core (~> 2.14.0)
|
||||||
rspec-expectations (~> 2.14.0)
|
rspec-expectations (~> 2.14.0)
|
||||||
|
@ -306,6 +314,8 @@ GEM
|
||||||
rack (~> 1.0)
|
rack (~> 1.0)
|
||||||
tilt (~> 1.1, != 1.3.0)
|
tilt (~> 1.1, != 1.3.0)
|
||||||
sqlite3 (1.3.8)
|
sqlite3 (1.3.8)
|
||||||
|
term-ansicolor (1.2.2)
|
||||||
|
tins (~> 0.8)
|
||||||
therubyracer (0.12.0)
|
therubyracer (0.12.0)
|
||||||
libv8 (~> 3.16.14.0)
|
libv8 (~> 3.16.14.0)
|
||||||
ref
|
ref
|
||||||
|
@ -315,6 +325,7 @@ GEM
|
||||||
rack (>= 1.0.0)
|
rack (>= 1.0.0)
|
||||||
thor (0.18.1)
|
thor (0.18.1)
|
||||||
tilt (1.4.1)
|
tilt (1.4.1)
|
||||||
|
tins (0.13.1)
|
||||||
treetop (1.4.15)
|
treetop (1.4.15)
|
||||||
polyglot
|
polyglot
|
||||||
polyglot (>= 0.3.1)
|
polyglot (>= 0.3.1)
|
||||||
|
@ -357,6 +368,7 @@ DEPENDENCIES
|
||||||
client_side_validations
|
client_side_validations
|
||||||
client_side_validations-simple_form
|
client_side_validations-simple_form
|
||||||
coffee-rails (~> 3.2.1)
|
coffee-rails (~> 3.2.1)
|
||||||
|
coveralls
|
||||||
daemons
|
daemons
|
||||||
database_cleaner
|
database_cleaner
|
||||||
exception_notification
|
exception_notification
|
||||||
|
|
|
@ -1,14 +1,26 @@
|
||||||
# optional test coverage
|
# optional test coverage
|
||||||
# needs to be loaded first, e.g. add a require at top of spec_helper
|
# needs to be loaded first, e.g. add a require at top of spec_helper
|
||||||
if ENV['COVERAGE']
|
if ENV['COVERAGE'] or ENV['COVERALLS']
|
||||||
require 'simplecov'
|
require 'simplecov'
|
||||||
|
|
||||||
|
# update coveralls.io on Travis CI
|
||||||
|
if ENV['COVERALLS']
|
||||||
|
require 'coveralls'
|
||||||
|
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
|
||||||
|
end
|
||||||
|
|
||||||
|
# slightly tweaked coverage reporting
|
||||||
|
def cov_no_plugins(source_file, path)
|
||||||
|
source_file.filename =~ /#{path}/ and not source_file.filename =~ /\/lib\/foodsoft_.*\//
|
||||||
|
end
|
||||||
SimpleCov.start do
|
SimpleCov.start do
|
||||||
add_filter '/spec/'
|
add_filter '/spec/'
|
||||||
add_filter '/test/'
|
add_filter '/test/'
|
||||||
add_group 'Models', '/app/models/'
|
add_group 'Models' do |s| cov_no_plugins s, '/app/models/' end
|
||||||
add_group 'Controllers', '/app/controllers/'
|
add_group 'Controllers' do |s| cov_no_plugins s, '/app/controllers/' end
|
||||||
add_group 'Helpers', '/app/helpers/'
|
add_group 'Helpers' do |s| cov_no_plugins s, '/app/helpers/' end
|
||||||
add_group 'Documents', '/app/documents/'
|
add_group 'Documents' do |s| cov_no_plugins s, '/app/documents/' end
|
||||||
add_group 'Libraries', '/lib/'
|
add_group 'Libraries' do |s| cov_no_plugins s, '/lib/' end
|
||||||
|
add_group 'Plugins' do |s| s.filename =~ /\/lib\/foodsoft_.*\// end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue