Skip to content

Commit

Permalink
Use new Codeclimate test reporter (#400)
Browse files Browse the repository at this point in the history
* Use new Codeclimate test reporter

It let's us combine the reports from both, rspec and test/unit.

* Check if coverage drop comes from config change

* Revert "Check if coverage drop comes from config change"

This reverts commit f8f91fe.
  • Loading branch information
tsujigiri authored and gedankenstuecke committed Jun 10, 2017
1 parent d214654 commit fcecb4f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
8 changes: 7 additions & 1 deletion .travis.yml
Expand Up @@ -16,6 +16,9 @@ before_script:
- cp config/database.yml.ci config/database.yml
- cp .env.example .env
- bundle exec rake db:setup
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > bin/cc-test-reporter
- chmod +x bin/cc-test-reporter
- bin/cc-test-reporter before-build
script: bundle exec rake
deploy:
provider: script
Expand All @@ -30,4 +33,7 @@ notifications:
on_failure: always # options: [always|never|change] default: always
on_start: never # options: [always|never|change] default: always
after_success:
- bundle exec codeclimate-test-reporter
- bin/cc-test-reporter format-coverage -t simplecov -o ./coverage/test-unit/codeclimate.json coverage/test-unit/.resultset.json
- bin/cc-test-reporter format-coverage -t simplecov -o ./coverage/rspec/codeclimate.json coverage/rspec/.resultset.json
- bin/cc-test-reporter sum-coverage --parts 2 coverage/test-unit/codeclimate.json coverage/rspec/codeclimate.json
- bin/cc-test-reporter upload-coverage
1 change: 0 additions & 1 deletion Gemfile
Expand Up @@ -62,7 +62,6 @@ gem 'sass-rails'
#end

group :test do
gem 'codeclimate-test-reporter', '~> 1.0.0'
gem 'test-unit' # TODO: Remove me
gem 'minitest' # TODO: Remove me
gem 'rspec-rails'
Expand Down
3 changes: 0 additions & 3 deletions Gemfile.lock
Expand Up @@ -94,8 +94,6 @@ GEM
cliver (0.3.2)
cocaine (0.5.8)
climate_control (>= 0.0.3, < 1.0)
codeclimate-test-reporter (1.0.8)
simplecov (<= 0.13)
coderay (1.1.1)
composite_primary_keys (8.1.5)
activerecord (~> 4.2.0)
Expand Down Expand Up @@ -402,7 +400,6 @@ DEPENDENCIES
bcrypt-ruby
capistrano (~> 2.0)
capybara
codeclimate-test-reporter (~> 1.0.0)
composite_primary_keys (~> 8.0)
database_cleaner
dotenv-rails
Expand Down
3 changes: 1 addition & 2 deletions Rakefile
Expand Up @@ -7,5 +7,4 @@ require 'rake'

Snpr::Application.load_tasks

task test: :spec
task default: :test
task default: [:spec, :test]
7 changes: 4 additions & 3 deletions spec/spec_helper.rb
@@ -1,8 +1,9 @@
# frozen_string_literal: true
require 'simplecov'
SimpleCov.start

ENV["RAILS_ENV"] ||= 'test'
require 'simplecov'
SimpleCov.start('rails') do
coverage_dir('coverage/rspec')
end
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'sidekiq/testing'
Expand Down
6 changes: 3 additions & 3 deletions test/test_helper.rb
@@ -1,8 +1,8 @@
# frozen_string_literal: true
ENV['RAILS_ENV'] = 'test'
unless ENV['CI']
require 'simplecov'
SimpleCov.start('rails')
require 'simplecov'
SimpleCov.start('rails') do
coverage_dir('coverage/test-unit')
end
require File.expand_path('../../config/environment', __FILE__)
require "test/unit"
Expand Down

0 comments on commit fcecb4f

Please sign in to comment.