From 19a27ae758482b0907c5b4bc45c63c2e2ccf322b Mon Sep 17 00:00:00 2001 From: Shawn Meredith Date: Tue, 25 Feb 2014 13:43:53 -0700 Subject: [PATCH] spec: vendored_gems coverage result merge with canvas Change-Id: Ic2bd9a9045da4aa417f60b66ef08ca9d470ec2bb Reviewed-on: https://gerrit.instructure.com/30829 Tested-by: Jenkins Reviewed-by: Bryan Madsen Product-Review: Bryan Madsen QA-Review: Bryan Madsen --- config/environments/test.rb | 5 +++++ .../spec/spec_helper.rb | 16 +++++++++------- gems/adheres_to_policy/spec/spec_helper.rb | 16 +++++++++------- .../spec/spec_helper.rb | 15 +++++++++------ gems/canvas_cassandra/spec/spec_helper.rb | 15 +++++++++------ gems/canvas_mimetype_fu/spec/spec_helper.rb | 14 +++++++++----- gems/html_text_helper/spec/spec_helper.rb | 18 +++++++++++------- gems/lti_outbound/spec/spec_helper.rb | 15 +++++++++------ 8 files changed, 70 insertions(+), 44 deletions(-) diff --git a/config/environments/test.rb b/config/environments/test.rb index 22be5a2bb48..169fe658893 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -6,6 +6,8 @@ if ENV['COVERAGE'] == "1" SimpleCov.command_name "RSpec:#{Process.pid}#{ENV['TEST_ENV_NUMBER']}" SimpleCov.start do + SimpleCov.use_merging + SimpleCov.merge_timeout(10000) class SimpleCov::Formatter::MergedFormatter def format(result) SimpleCov::Formatter::HTMLFormatter.new.format(result) @@ -23,9 +25,12 @@ if ENV['COVERAGE'] == "1" add_group 'Models', 'app/models' add_group 'Services', 'app/services' add_group 'App', '/app/' + add_group 'Gems', 'gems/' add_group 'Helpers', 'app/helpers' add_group 'Libraries', '/lib/' add_group 'Plugins', 'vendor/plugins' + add_group 'Db', '/db/' + add_group "Long files" do |src_file| src_file.lines.count > 500 end diff --git a/gems/activesupport-suspend_callbacks/spec/spec_helper.rb b/gems/activesupport-suspend_callbacks/spec/spec_helper.rb index 74904d58d5d..bae70efe52b 100644 --- a/gems/activesupport-suspend_callbacks/spec/spec_helper.rb +++ b/gems/activesupport-suspend_callbacks/spec/spec_helper.rb @@ -5,19 +5,21 @@ # # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration - require 'simplecov' require 'simplecov-rcov' -SimpleCov.coverage_dir('../../coverage') -SimpleCov.at_exit { - SimpleCov.result -} + SimpleCov.command_name('activesupport-suspend-callback-gem') -SimpleCov.start('test_frameworks') +SimpleCov.start do + SimpleCov.coverage_dir('../../coverage') + SimpleCov.use_merging + SimpleCov.merge_timeout(10000) + SimpleCov.at_exit { + SimpleCov.result + } +end require "active_support/callbacks/suspension" - RSpec.configure do |config| config.treat_symbols_as_metadata_keys_with_true_values = true config.run_all_when_everything_filtered = true diff --git a/gems/adheres_to_policy/spec/spec_helper.rb b/gems/adheres_to_policy/spec/spec_helper.rb index 51fd9ffeed4..b09ea146894 100644 --- a/gems/adheres_to_policy/spec/spec_helper.rb +++ b/gems/adheres_to_policy/spec/spec_helper.rb @@ -5,19 +5,21 @@ # # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration - require 'simplecov' require 'simplecov-rcov' -SimpleCov.coverage_dir('../../coverage') -SimpleCov.at_exit { - SimpleCov.result -} + SimpleCov.command_name('adheres-to-policy-gem') -SimpleCov.start('test_frameworks') +SimpleCov.start('test_frameworks') do + SimpleCov.coverage_dir('../../coverage') + SimpleCov.use_merging + SimpleCov.merge_timeout(10000) + SimpleCov.at_exit { + SimpleCov.result + } +end require 'adheres_to_policy' - RSpec.configure do |config| config.treat_symbols_as_metadata_keys_with_true_values = true config.run_all_when_everything_filtered = true diff --git a/gems/canvas_breach_mitigation/spec/spec_helper.rb b/gems/canvas_breach_mitigation/spec/spec_helper.rb index b961042e755..72d0b853441 100644 --- a/gems/canvas_breach_mitigation/spec/spec_helper.rb +++ b/gems/canvas_breach_mitigation/spec/spec_helper.rb @@ -7,18 +7,21 @@ require 'simplecov' require 'simplecov-rcov' -SimpleCov.coverage_dir('../../coverage') -SimpleCov.at_exit { - SimpleCov.result -} + SimpleCov.command_name('canvas-breach-mitigation-gem') -SimpleCov.start('test_frameworks') +SimpleCov.start('test_frameworks') do + SimpleCov.coverage_dir('../../coverage') + SimpleCov.use_merging + SimpleCov.merge_timeout(10000) + SimpleCov.at_exit { + SimpleCov.result + } +end require "canvas_breach_mitigation" require 'securerandom' require 'base64' - RSpec.configure do |config| config.treat_symbols_as_metadata_keys_with_true_values = true config.run_all_when_everything_filtered = true diff --git a/gems/canvas_cassandra/spec/spec_helper.rb b/gems/canvas_cassandra/spec/spec_helper.rb index e8a340c94e6..60857476937 100644 --- a/gems/canvas_cassandra/spec/spec_helper.rb +++ b/gems/canvas_cassandra/spec/spec_helper.rb @@ -25,17 +25,20 @@ require 'simplecov' require 'simplecov-rcov' -SimpleCov.coverage_dir('../../coverage') -SimpleCov.at_exit { - SimpleCov.result -} + SimpleCov.command_name('canvas-cassandra-gem') -SimpleCov.start('test_frameworks') +SimpleCov.start('test_frameworks') do + SimpleCov.coverage_dir('../../coverage') + SimpleCov.use_merging + SimpleCov.merge_timeout(10000) + SimpleCov.at_exit { + SimpleCov.result + } +end require "canvas_cassandra" require "yaml" - RSpec.configure do |config| config.treat_symbols_as_metadata_keys_with_true_values = true config.run_all_when_everything_filtered = true diff --git a/gems/canvas_mimetype_fu/spec/spec_helper.rb b/gems/canvas_mimetype_fu/spec/spec_helper.rb index 5390cedf521..60a95b12411 100644 --- a/gems/canvas_mimetype_fu/spec/spec_helper.rb +++ b/gems/canvas_mimetype_fu/spec/spec_helper.rb @@ -7,12 +7,16 @@ require 'simplecov' require 'simplecov-rcov' -SimpleCov.coverage_dir('../../coverage') -SimpleCov.at_exit { - SimpleCov.result -} + SimpleCov.command_name('canvas-mimetype-fu-gem') -SimpleCov.start('test_frameworks') +SimpleCov.start('test_frameworks') do + SimpleCov.coverage_dir('../../coverage') + SimpleCov.use_merging + SimpleCov.merge_timeout(10000) + SimpleCov.at_exit { + SimpleCov.result + } +end require "tempfile" require "canvas_mimetype_fu" diff --git a/gems/html_text_helper/spec/spec_helper.rb b/gems/html_text_helper/spec/spec_helper.rb index 66aac0145a5..fde4a0d9520 100644 --- a/gems/html_text_helper/spec/spec_helper.rb +++ b/gems/html_text_helper/spec/spec_helper.rb @@ -7,14 +7,18 @@ require 'simplecov' require 'simplecov-rcov' -SimpleCov.coverage_dir('../../coverage') -SimpleCov.at_exit { - SimpleCov.result -} -SimpleCov.command_name('html-text-helper-spec-gem') -SimpleCov.start('test_frameworks') -require 'html_text_helper' +SimpleCov.command_name('html-text-helper-spec-gem') +SimpleCov.start('test_frameworks') do + SimpleCov.coverage_dir('../../coverage') + SimpleCov.use_merging + SimpleCov.merge_timeout(10000) + SimpleCov.at_exit { + SimpleCov.result + } +end + +require 'html_text_helper' RSpec.configure do |config| config.treat_symbols_as_metadata_keys_with_true_values = true diff --git a/gems/lti_outbound/spec/spec_helper.rb b/gems/lti_outbound/spec/spec_helper.rb index ea50aa07690..b715cbade33 100644 --- a/gems/lti_outbound/spec/spec_helper.rb +++ b/gems/lti_outbound/spec/spec_helper.rb @@ -7,16 +7,19 @@ require 'simplecov' require 'simplecov-rcov' - SimpleCov.coverage_dir('../../coverage') - SimpleCov.at_exit { - SimpleCov.result -} SimpleCov.command_name('lti_outbound-gem') -SimpleCov.start('test_frameworks') - +SimpleCov.start('test_frameworks') do + SimpleCov.coverage_dir('../../coverage') + SimpleCov.use_merging + SimpleCov.merge_timeout(10000) + SimpleCov.at_exit { + SimpleCov.result + } +end require 'lti_outbound' + Dir.glob("#{File.dirname(__FILE__).gsub(/\\/, "/")}/shared_examples/*.rb").each { |file| require file } Dir.glob("#{File.dirname(__FILE__).gsub(/\\/, "/")}/support/*.rb").each { |file| require file }