mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #1916 from maxlinc/code_coverage
Code coverage (cleanup based on PR comments)
This commit is contained in:
commit
e93a632167
2 changed files with 12 additions and 14 deletions
10
Rakefile
10
Rakefile
|
@ -53,20 +53,15 @@ require "tasks/test_task"
|
||||||
Fog::Rake::TestTask.new
|
Fog::Rake::TestTask.new
|
||||||
|
|
||||||
namespace :test do
|
namespace :test do
|
||||||
|
mock = 'true' || ENV['FOG_MOCK']
|
||||||
task :travis do
|
task :travis do
|
||||||
[true].each do |mock|
|
|
||||||
sh("export FOG_MOCK=#{mock} && bundle exec shindont")
|
sh("export FOG_MOCK=#{mock} && bundle exec shindont")
|
||||||
end
|
|
||||||
end
|
end
|
||||||
task :vsphere do
|
task :vsphere do
|
||||||
[true].each do |mock|
|
|
||||||
sh("export FOG_MOCK=#{mock} && bundle exec shindont tests/vsphere")
|
sh("export FOG_MOCK=#{mock} && bundle exec shindont tests/vsphere")
|
||||||
end
|
|
||||||
end
|
end
|
||||||
task :openvz do
|
task :openvz do
|
||||||
[true].each do |mock|
|
|
||||||
sh("export FOG_MOCK=#{mock} && bundle exec shindont tests/openvz")
|
sh("export FOG_MOCK=#{mock} && bundle exec shindont tests/openvz")
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -194,7 +189,8 @@ require "tasks/changelog_task"
|
||||||
Fog::Rake::ChangelogTask.new
|
Fog::Rake::ChangelogTask.new
|
||||||
|
|
||||||
task :coveralls_push_workaround do
|
task :coveralls_push_workaround do
|
||||||
if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('1.9')
|
ENV['COVERAGE'] = 'false' if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('1.9')
|
||||||
|
unless ENV['COVERAGE'] == 'false'
|
||||||
require 'coveralls/rake/task'
|
require 'coveralls/rake/task'
|
||||||
Coveralls::RakeTask.new
|
Coveralls::RakeTask.new
|
||||||
Rake::Task["coveralls:push"].invoke
|
Rake::Task["coveralls:push"].invoke
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
require 'simplecov'
|
require 'simplecov'
|
||||||
require 'coveralls'
|
require 'coveralls'
|
||||||
|
|
||||||
SimpleCov.command_name "shindo:#{Process.pid.to_s}"
|
unless ENV['COVERAGE'] == 'false'
|
||||||
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
SimpleCov.command_name "shindo:#{Process.pid.to_s}"
|
||||||
SimpleCov::Formatter::HTMLFormatter,
|
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
||||||
Coveralls::SimpleCov::Formatter
|
SimpleCov::Formatter::HTMLFormatter,
|
||||||
]
|
Coveralls::SimpleCov::Formatter
|
||||||
SimpleCov.merge_timeout 3600
|
]
|
||||||
SimpleCov.start if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('1.9')
|
SimpleCov.merge_timeout 3600
|
||||||
|
SimpleCov.start
|
||||||
|
end
|
||||||
|
|
||||||
ENV['FOG_RC'] = ENV['FOG_RC'] || File.expand_path('../.fog', __FILE__)
|
ENV['FOG_RC'] = ENV['FOG_RC'] || File.expand_path('../.fog', __FILE__)
|
||||||
ENV['FOG_CREDENTIAL'] = ENV['FOG_CREDENTIAL'] || 'default'
|
ENV['FOG_CREDENTIAL'] = ENV['FOG_CREDENTIAL'] || 'default'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue