diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 000000000..84a6808a2 --- /dev/null +++ b/.codecov.yml @@ -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: off + patch: off diff --git a/.coveralls.yml b/.coveralls.yml deleted file mode 100644 index 333dc951d..000000000 --- a/.coveralls.yml +++ /dev/null @@ -1,2 +0,0 @@ -service_name: travis-ci -repo_token: REPO_TOKEN diff --git a/.gitignore b/.gitignore index f97bae752..e85bb8860 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,7 @@ log/ tmp/* tmp/**/* -coverage* +coverage/ public/warpables/* public/system/* public/warps/* @@ -41,4 +41,5 @@ public/lib node_modules todo.txt .sass-cache -.byebug_history \ No newline at end of file +.byebug_history +coverage_report/ diff --git a/.rubocop.yml b/.rubocop.yml index 858284ac5..920745d01 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -121,3 +121,6 @@ Layout: # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. Lint/RequireParentheses: Enabled: true + +Metrics/LineLength: + Max: 100 diff --git a/.simplecov b/.simplecov new file mode 100644 index 000000000..2bd5dffa0 --- /dev/null +++ b/.simplecov @@ -0,0 +1,14 @@ +require 'simplecov-cobertura' + +if ENV['CI'] == 'true' + SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter +else + SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter +end + +SimpleCov.start 'rails' do + add_filter '/test/' + add_filter '/db/' + add_filter '/log/' + add_filter '/tmp/' +end diff --git a/.travis.yml b/.travis.yml old mode 100644 new mode 100755 index 39d0a5759..f5e97b730 --- a/.travis.yml +++ b/.travis.yml @@ -12,10 +12,10 @@ install: - docker-compose exec web bash -l -c "rake db:setup || rake db:migrate" script: - - sed -ri "s/REPO_TOKEN/$REPO_TOKEN/" .coveralls.yml - docker-compose exec web bash -l -c "CI=true TRAVIS=true rake test:all" + - bash <(curl -s https://codecov.io/bash) branches: - only: + only: - main - unstable diff --git a/Gemfile b/Gemfile index 8e5430c20..65f17d66e 100644 --- a/Gemfile +++ b/Gemfile @@ -19,7 +19,6 @@ group :dependencies do gem "ruby-openid", "~>2.5" gem "open_id_authentication" gem "RubyInline" - gem "coveralls", require: false gem "paperclip", "~>4.3.7" # if you use amazon s3 for warpable image storage @@ -40,8 +39,10 @@ group :dependencies do end group :test do - gem 'test-unit' gem "rubocop" + gem 'simplecov', require: false + gem 'simplecov-cobertura', require: false + gem 'test-unit' end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index 4289884bb..6e2e74569 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -45,12 +45,6 @@ GEM cocaine (0.5.8) climate_control (>= 0.0.3, < 1.0) concurrent-ruby (1.1.5) - coveralls (0.8.22) - json (>= 1.8, < 3) - simplecov (~> 0.16.1) - term-ansicolor (~> 1.3) - thor (~> 0.19.4) - tins (~> 1.6) docile (1.3.1) erubis (2.7.0) execjs (2.7.0) @@ -154,6 +148,8 @@ GEM docile (~> 1.1) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) + simplecov-cobertura (1.3.1) + simplecov (~> 0.8) simplecov-html (0.10.2) sprockets (2.2.3) hike (~> 1.2) @@ -161,8 +157,6 @@ GEM rack (~> 1.0) tilt (~> 1.1, != 1.3.0) sqlite3 (1.4.0) - term-ansicolor (1.7.1) - tins (~> 1.0) test-unit (3.3.2) power_assert therubyracer (0.12.3) @@ -170,7 +164,6 @@ GEM ref thor (0.19.4) tilt (1.4.1) - tins (1.20.2) treetop (1.4.15) polyglot polyglot (>= 0.3.1) @@ -190,7 +183,6 @@ DEPENDENCIES autoprefixer-rails aws-sdk (~> 1.5.7) byebug - coveralls friendly_id geokit-rails (= 1.1.4) image_science (= 1.2.6) @@ -208,6 +200,8 @@ DEPENDENCIES right_aws ruby-openid (~> 2.5) sass + simplecov + simplecov-cobertura sprockets sqlite3 test-unit diff --git a/README.md b/README.md index 5f46d4ee9..2d745afe1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## MapKnitter 2 [![Coverage Status](https://coveralls.io/repos/github/publiclab/mapknitter/badge.svg?branch=%28HEAD+detached+at+FETCH_HEAD%29)](https://coveralls.io/github/publiclab/mapknitter?branch=%28HEAD+detached+at+FETCH_HEAD%29) +## MapKnitter 2 [![Coverage Status](https://coveralls.io/repos/github/publiclab/mapknitter/badge.svg?branch=%28HEAD+detached+at+FETCH_HEAD%29)](https://coveralls.io/github/publiclab/mapknitter?branch=%28HEAD+detached+at+FETCH_HEAD%29) [![codecov](https://codecov.io/gh/publiclab/mapknitter/branch/main/graph/badge.svg)](https://codecov.io/gh/publiclab/mapknitter) Use Public Lab's open source MapKnitter to upload your own aerial photographs (for example those from balloon or kite mapping: http://publiclab.org/balloon-mapping) and combine them into: diff --git a/test/test_helper.rb b/test/test_helper.rb index 320e5e9ae..8b0be3ba0 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,6 +1,7 @@ -require 'coveralls' -Coveralls.wear!('rails') ENV["RAILS_ENV"] = "test" + +require 'simplecov' + require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help'