From cd7b3f54f1617294decc70f0858bcf180db7fba4 Mon Sep 17 00:00:00 2001 From: Fabian Rodriguez Date: Fri, 27 Feb 2015 22:41:32 -0200 Subject: [PATCH 1/4] Removes the following deprecation warning: 'method adapters is deprecated. use profiles instead' This warning was showing up because the project was using the gem 'simplecov-gem-adapter' which uses the old syntax. * Remove the gem dependency * Add a profile with the same setup that the gem has --- Gemfile | 1 - lib/simplecov_custom_profile.rb | 13 +++++++++++++ test/helper.rb | 3 +-- 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 lib/simplecov_custom_profile.rb diff --git a/Gemfile b/Gemfile index d695524b..f29e4abd 100644 --- a/Gemfile +++ b/Gemfile @@ -19,7 +19,6 @@ gem 'maruku', '~> 0.7.0' gem 'rdiscount', '~> 2.0' gem 'launchy', '~> 2.3' gem 'simplecov', '~> 0.9' -gem 'simplecov-gem-adapter', '~> 1.0.1' gem 'mime-types', '~> 1.5' gem 'activesupport', '~> 3.2.13' gem 'jekyll_test_plugin' diff --git a/lib/simplecov_custom_profile.rb b/lib/simplecov_custom_profile.rb new file mode 100644 index 00000000..eebb8fbe --- /dev/null +++ b/lib/simplecov_custom_profile.rb @@ -0,0 +1,13 @@ +require 'simplecov' + +SimpleCov.profiles.define 'gem' do + add_filter '/test/' + add_filter '/features/' + add_filter '/spec/' + add_filter '/autotest/' + + add_group 'Binaries', '/bin/' + add_group 'Libraries', '/lib/' + add_group 'Extensions', '/ext/' + add_group 'Vendor Libraries', '/vendor/' +end diff --git a/test/helper.rb b/test/helper.rb index 257b2db9..4efa1f96 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,5 +1,4 @@ -require 'simplecov' -require 'simplecov-gem-adapter' +require 'simplecov_custom_profile' SimpleCov.start('gem') do add_filter "/vendor/bundle" add_filter "/vendor/gem" From e4b1382bfdfaa5737b5d203dd73d1c7c1eb6666c Mon Sep 17 00:00:00 2001 From: Fabian Rodriguez Date: Fri, 27 Feb 2015 23:09:33 -0200 Subject: [PATCH 2/4] Remove unused groups from simplecov's profile --- lib/simplecov_custom_profile.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/simplecov_custom_profile.rb b/lib/simplecov_custom_profile.rb index eebb8fbe..d7f4914c 100644 --- a/lib/simplecov_custom_profile.rb +++ b/lib/simplecov_custom_profile.rb @@ -3,11 +3,8 @@ require 'simplecov' SimpleCov.profiles.define 'gem' do add_filter '/test/' add_filter '/features/' - add_filter '/spec/' add_filter '/autotest/' add_group 'Binaries', '/bin/' add_group 'Libraries', '/lib/' - add_group 'Extensions', '/ext/' - add_group 'Vendor Libraries', '/vendor/' end From fbe52bca85b66ad89040ecd1519dc9021ab5a532 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 1 Mar 2015 00:36:20 -0800 Subject: [PATCH 3/4] Move simplecov_custom_profile to test/ & gate with TRAVIS env --- test/helper.rb | 10 ++++++---- {lib => test}/simplecov_custom_profile.rb | 0 2 files changed, 6 insertions(+), 4 deletions(-) rename {lib => test}/simplecov_custom_profile.rb (100%) diff --git a/test/helper.rb b/test/helper.rb index 4efa1f96..dd6b38da 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,7 +1,9 @@ -require 'simplecov_custom_profile' -SimpleCov.start('gem') do - add_filter "/vendor/bundle" - add_filter "/vendor/gem" +unless ENV['TRAVIS'] + require File.expand_path('../simplecov_custom_profile', __FILE__) + SimpleCov.start('gem') do + add_filter "/vendor/bundle" + add_filter "/vendor/gem" + end end require 'rubygems' diff --git a/lib/simplecov_custom_profile.rb b/test/simplecov_custom_profile.rb similarity index 100% rename from lib/simplecov_custom_profile.rb rename to test/simplecov_custom_profile.rb From f1edf9e692389f445eabbf45198722758026dd9d Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 1 Mar 2015 00:36:40 -0800 Subject: [PATCH 4/4] Add minitest/profile to profile 10 slowest tests --- Gemfile | 1 + script/test | 2 +- test/helper.rb | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index f29e4abd..625cd5f9 100644 --- a/Gemfile +++ b/Gemfile @@ -26,6 +26,7 @@ gem 'jekyll_test_plugin_malicious' gem 'liquid-c', '~> 0.0.3' gem 'minitest' gem 'minitest-reporters' +gem 'minitest-profile' gem 'test-unit' if RUBY_PLATFORM =~ /cygwin/ || RUBY_VERSION.start_with?("2.2") if ENV['BENCHMARK'] diff --git a/script/test b/script/test index 38ae46b6..7da787d5 100755 --- a/script/test +++ b/script/test @@ -20,4 +20,4 @@ fi set -x -time bundle exec ruby -Ilib -Itest -rloader $TEST_FILES +time bundle exec ruby -Ilib -Itest -rloader $TEST_FILES --profile diff --git a/test/helper.rb b/test/helper.rb index dd6b38da..e4a50db0 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -10,6 +10,7 @@ require 'rubygems' require 'ostruct' require 'minitest/autorun' require 'minitest/reporters' +require 'minitest/profile' require 'jekyll'