Skip to content

Commit

Permalink
Add coveralls. Setup travis to run with coveralls code coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
mscoutermarsh committed Jan 18, 2014
1 parent f6bbdf3 commit 1d06267
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 3 deletions.
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
service_name: travis-ci
6 changes: 4 additions & 2 deletions .simplecov
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'coveralls'
SimpleCov.use_merging true
SimpleCov.start do
add_filter "/test/"
end
add_filter 'test'
end
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ before_script:
- './test/rust/bootstrap.sh'
- './test/erlang/bootstrap.sh'
script:
- 'RACK_ENV=test CI=1 bundle exec rake db:migrate test:each'
- 'RACK_ENV=test CI=1 bundle exec rake db:migrate test_with_coverage'
- '( cd frontend && npm install && lineman spec-ci )'
- '( export PATH=/opt/hp-2013.2.0.0/bin:$PATH; runhaskell ./test/haskell/check-exercises.hs )'
- 'make test --directory=assignments/javascript'
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ group :test, :development do
gem 'rack-test', require: false
gem 'mocha', require: false
gem 'simplecov', require: false
gem 'coveralls', require: false
gem 'faker', '~> 1.2', require: false # for seed data
gem 'foreman', require: false
gem 'sqlite3'
Expand Down
12 changes: 12 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ GEM
atomic (1.1.14)
builder (3.1.4)
coderay (1.1.0)
coveralls (0.7.0)
multi_json (~> 1.3)
rest-client
simplecov (>= 0.7)
term-ansicolor
thor
database_cleaner (1.2.0)
docile (1.1.1)
dotenv (0.9.0)
Expand Down Expand Up @@ -74,6 +80,8 @@ GEM
rack (>= 1.0)
rake (10.1.1)
redcarpet (3.0.0)
rest-client (1.6.7)
mime-types (>= 1.16)
rouge (1.3.2)
ruby-prof (0.14.2)
simplecov (0.8.2)
Expand All @@ -87,10 +95,13 @@ GEM
tilt (~> 1.3, >= 1.3.4)
slop (3.4.7)
sqlite3 (1.3.8)
term-ansicolor (1.2.2)
tins (~> 0.8)
thor (0.18.1)
thread_safe (0.1.3)
atomic
tilt (1.4.1)
tins (0.13.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
Expand All @@ -105,6 +116,7 @@ PLATFORMS
DEPENDENCIES
activerecord (~> 4.0)
approvals
coveralls
database_cleaner
faker (~> 1.2)
faraday
Expand Down
7 changes: 7 additions & 0 deletions lib/tasks/coveralls.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'coveralls/rake/task'
Coveralls::RakeTask.new
task :test_with_coverage do
ENV['COVERAGE'] = 1
Rake::Task["test"].invoke
Rake::Task["coveralls:push"].invoke
end
1 change: 1 addition & 0 deletions test/api_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'simplecov' if ENV['COVERAGE']
require './test/integration_helper'
require './test/approval_helper'

Expand Down
1 change: 1 addition & 0 deletions test/app_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'simplecov' if ENV['COVERAGE']
require './test/integration_helper'
require './test/approval_helper'

Expand Down

0 comments on commit 1d06267

Please sign in to comment.