From 00d2d4d4cbaeee8ba95a464969f7163d891e5d95 Mon Sep 17 00:00:00 2001 From: xanderj22 <44005921+xanderj22@users.noreply.github.com> Date: Wed, 17 Apr 2019 19:31:48 -0400 Subject: [PATCH 1/2] Update feeds_controller.rb (#486) First time commit (xanderj22). Updated feeds_controller.rb (Updated ActiveRecord query syntax to more recent style #435) From 7c1d1b82e952c0d8a73d087e929cfc7dbd1172cd Mon Sep 17 00:00:00 2001 From: Jeffrey Warren Date: Thu, 18 Apr 2019 16:08:15 -0400 Subject: [PATCH 2/2] Attempt to install codecov (#543) * Attempt to install codecov * Create .codecov.yml * Update .travis.yml * Add simplecov * Add docker volume and change formatter * Remove unneccessary files and fix rubocop issues * Remove coveralls and add more filters * modify gitignore * add .simplecov file * remove docker volume --- .codecov.yml | 11 +++++++++++ .coveralls.yml | 2 -- .gitignore | 5 +++-- .simplecov | 14 ++++++++++++++ .travis.yml | 4 ++-- Gemfile | 3 ++- Gemfile.lock | 14 ++++---------- README.md | 2 +- test/test_helper.rb | 5 +++-- 9 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 .codecov.yml delete mode 100644 .coveralls.yml create mode 100644 .simplecov mode change 100644 => 100755 .travis.yml 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/.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 1a4e65be5..13612711d 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,6 +39,8 @@ group :dependencies do end group :test do + gem 'simplecov', require: false + gem 'simplecov-cobertura', require: false gem 'test-unit' end 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'