From ad17bbff9c59ef5d0490e6af317f7ce2d3069f69 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Tue, 20 Sep 2016 16:39:16 +0100 Subject: [PATCH] cask-tests: fix loading simplecov --- Library/Homebrew/cask/Rakefile | 12 ++++++++++++ Library/Homebrew/cask/cmd/brew-cask-tests.rb | 5 +---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/cask/Rakefile b/Library/Homebrew/cask/Rakefile index c30b2f6717..fe3e75c988 100644 --- a/Library/Homebrew/cask/Rakefile +++ b/Library/Homebrew/cask/Rakefile @@ -6,6 +6,18 @@ homebrew_repo = `brew --repository`.chomp $LOAD_PATH.unshift(File.expand_path("#{homebrew_repo}/Library/Homebrew")) $LOAD_PATH.unshift(File.expand_path("../lib", __FILE__)) +namespace :test do + namespace :coverage do + desc "Upload coverage to Codecov" + task :upload do + require "simplecov" + require "codecov" + formatter = SimpleCov::Formatter::Codecov.new + formatter.format(SimpleCov::ResultMerger.merged_result) + end + end +end + RuboCop::RakeTask.new(:rubocop) do |t| t.options = ["--force-exclusion"] end diff --git a/Library/Homebrew/cask/cmd/brew-cask-tests.rb b/Library/Homebrew/cask/cmd/brew-cask-tests.rb index 2523061a2e..19a21275e4 100755 --- a/Library/Homebrew/cask/cmd/brew-cask-tests.rb +++ b/Library/Homebrew/cask/cmd/brew-cask-tests.rb @@ -38,10 +38,7 @@ repo_root.cd do end if ENV["CODECOV_TOKEN"] - require "simplecov" - require "codecov" - formatter = SimpleCov::Formatter::Codecov.new - formatter.format(SimpleCov::ResultMerger.merged_result) + system "bundle", "exec", "rake", "test:coverage:upload" end Homebrew.failed = !$CHILD_STATUS.success?