Skip to content

Commit

Permalink
Remove coveralls, add codecov (publiclab#5954)
Browse files Browse the repository at this point in the history
* Remove coveralls, add codecov

* Add env variable

* Comment reporting lines

* Change env variable

* Remove coveralls from rake file

* Fix travis and rakefile

* Remove project for codecov

* Remove old reports before running

* typo replace omment with comment (publiclab#7042)

* typo replace omment with comment

* Update blog.css

* Update .travis.yml

* Update .travis.yml

* add codecov branch to travis for debugging

Co-authored-by: Uzay-G <[email protected]>
Co-authored-by: Jeffrey Warren <[email protected]>
  • Loading branch information
3 people authored and Tlazypanda committed Jan 14, 2020
1 parent dac1499 commit 8ecd98f
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 22 deletions.
11 changes: 11 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
comment:
layout: "reach, diff, flags, files"
behavior: default
require_changes: false # if true: only post the comment if coverage changes
require_base: no # [yes :: must have a base report to post]
require_head: yes # [yes :: must have a head report to post]
branches: null # branch names that can post comment
coverage:
status:
project: on
patch: on
22 changes: 22 additions & 0 deletions .simplecov
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
SimpleCov.start

if ENV['CI'] == 'true'
require 'codecov'
SimpleCov.formatter = SimpleCov::Formatter::Codecov
else
SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
end

SimpleCov.start 'rails' do
add_group 'Units', 'app/models'
add_group 'Functionals', 'app/controllers'
add_group 'Services', 'app/services'
add_group 'Libraries', 'lib/'

add_filter '/test/'
add_filter '/config/'
add_filter '/db/'
add_filter '/vendor/'
add_filter '/log/'
add_filter '/tmp/'
end
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ git:
env:
global:
- COMPOSE_FILE=./containers/docker-compose-testing.yml
- CI=true
matrix:
- TASK="rake test:all"
- TASK="rails test test/unit"
- TASK="rails test test/functional"
- TASK="rails test test/integration"
- TASK="rails test:system"

before_install:
- echo -e "repo_token:\n $COVERALLS_REPO_TOKEN" >> ./.coveralls.yml

branches:
only:
- master
- unstable
- codecov

install:
- rm -rf test/reports
- cp config/database.yml.example config/database.yml
- cp db/schema.rb.example db/schema.rb
- docker-compose build
Expand All @@ -40,7 +40,7 @@ install:

script:
- docker-compose exec web bash -c 'echo "$GOOGLE_APPLICATION_CREDENTIALS_JSON" > /tmp/credentials.json' # needs to be a path to a json file, so we shuffle...
- docker-compose exec web bash -c "CI=TRUE GENERATE_REPORT=true $TASK"
- docker-compose exec web bash -c "GENERATE_REPORT=true $TASK"
- if [ $TASK != "rake test:all" ]; then
echo -e '<?xml version="1.0" encoding="UTF-8"?>' > output.xml;
tail -n +2 -q ./test/reports/TEST*.xml >> output.xml;
Expand Down
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ end
group :test, :development do
gem 'capybara'
gem 'ci_reporter_test_unit'
gem 'coveralls', require: false
gem 'simplecov', require: false
gem 'codecov', require: false
gem 'jasmine-jquery-rails'
gem 'jasmine-rails'
gem 'json_expressions'
Expand Down
17 changes: 7 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ GEM
ci_reporter (~> 2.0)
test-unit (>= 2.5.5, < 4.0)
climate_control (0.2.0)
codecov (0.1.14)
json
simplecov
url
coderay (1.1.2)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
Expand All @@ -101,12 +105,6 @@ GEM
activerecord (~> 5.2.1)
concurrent-ruby (1.1.5)
connection_pool (2.2.2)
coveralls (0.8.23)
json (>= 1.8, < 3)
simplecov (~> 0.16.1)
term-ansicolor (~> 1.3)
thor (>= 0.19.4, < 2.0)
tins (~> 1.6)
crass (1.0.5)
declarative (0.0.10)
declarative-option (0.1.0)
Expand Down Expand Up @@ -495,8 +493,6 @@ GEM
railties (>= 3.2.5, < 6)
teaspoon-mocha (2.3.3)
teaspoon (>= 1.0.0)
term-ansicolor (1.7.1)
tins (~> 1.0)
terrapin (0.6.0)
climate_control (>= 0.0.3, < 1.0)
test-unit (3.3.4)
Expand All @@ -508,7 +504,6 @@ GEM
thread_safe (0.3.6)
tilt (2.0.9)
timecop (0.9.1)
tins (1.20.2)
turbolinks (5.2.0)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
Expand All @@ -533,6 +528,7 @@ GEM
unf_ext (0.0.7.6)
unicode-display_width (1.6.0)
unicode-emoji (2.3.1)
url (0.3.2)
virtus (1.0.5)
axiom-types (~> 0.1)
coercible (~> 1.0)
Expand Down Expand Up @@ -565,9 +561,9 @@ DEPENDENCIES
byebug
capybara
ci_reporter_test_unit
codecov
coffee-rails (~> 5.0.0)
composite_primary_keys
coveralls
execjs
figaro
friendly_id
Expand Down Expand Up @@ -640,6 +636,7 @@ DEPENDENCIES
selenium-webdriver (~> 3.142.6)
sentry-raven
sidekiq
simplecov
skylight
sqlite3 (~> 1.3.6)
teaspoon-mocha
Expand Down
3 changes: 0 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@ namespace :test do

desc "Run rails and teaspoon tests"
task :all => :environment do
require 'coveralls/rake/task'
Coveralls::RakeTask.new
if ENV['GENERATE_REPORT'] == 'true'
require 'ci/reporter/rake/test_unit'
Rake::Task["ci:setup:testunit"].execute
end
puts "Running teaspoon tests headlessly"
Rake::Task["teaspoon"].execute
Rake::Task["coveralls:push"].execute
end
end
2 changes: 1 addition & 1 deletion app/assets/stylesheets/blog.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
font-size:4em;
margin-top:100px;
color:#326;
line-height:1.3em;
line-height:1.3em
}

.blog h1 {
Expand Down
4 changes: 1 addition & 3 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
require 'coveralls'
Coveralls.wear!

require 'simplecov'
ENV['RAILS_ENV'] = 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
Expand Down

0 comments on commit 8ecd98f

Please sign in to comment.