Sha256: 4dfc4fd2733957f4eb8eb6d322b66c36ec22967fa08f5499c558418ac56cfc27

Contents?: true

Size: 1.15 KB

Versions: 32

Compression:

Stored size: 1.15 KB

Contents

require "rake"
require "rake/tasklib"

module Fog
  module Rake
    class TestTask < ::Rake::TaskLib

      def initialize
        desc "Run the mocked tests"
        task :test do
          ::Rake::Task[:mock_tests].invoke
        end

        task :mock_tests do
          tests(true)
        end

        task :real_tests do
          tests(false)
        end
      end

      def tests(mocked)
        Formatador.display_line
        start = Time.now.to_i
        threads = []
        Thread.main[:results] = []
        Fog.providers.each do |key, value|
          next if key == :hp
          threads << Thread.new do
            Thread.main[:results] << {
              :provider => value,
              :success  => sh("export FOG_MOCK=#{mocked} && bundle exec shindont +#{key}")
            }
          end
        end
        threads.each do |thread|
          thread.join
        end
        Formatador.display_table(Thread.main[:results].sort {|x,y| x[:provider] <=> y[:provider]})
        Formatador.display_line("[bold]FOG_MOCK=#{mocked}[/] tests completed in [bold]#{Time.now.to_i - start}[/] seconds")
        Formatador.display_line
      end

    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
fog-maestrodev-1.20.0.20140305101839 lib/tasks/test_task.rb
fog-maestrodev-1.20.0.20140305101305 lib/tasks/test_task.rb
fog-maestrodev-1.19.0.20140212012611 lib/tasks/test_task.rb
fog-maestrodev-1.19.0.20140110004459 lib/tasks/test_task.rb
fog-maestrodev-1.19.0.20140110003812 lib/tasks/test_task.rb
fog-maestrodev-1.19.0.20140109202555 lib/tasks/test_task.rb
fog-maestrodev-1.19.0.20140107192102 lib/tasks/test_task.rb
fog-maestrodev-1.19.0.20140107142106 lib/tasks/test_task.rb
fog-maestrodev-1.19.0.20131219203941 lib/tasks/test_task.rb
fog-maestrodev-1.18.0.20131219193542 lib/tasks/test_task.rb
fog-maestrodev-1.18.0.20131219033443 lib/tasks/test_task.rb
fog-maestrodev-1.18.0.20131219032002 lib/tasks/test_task.rb
fog-maestrodev-1.18.0.20131219030716 lib/tasks/test_task.rb
fog-maestrodev-1.18.0.20131219022322 lib/tasks/test_task.rb
fog-maestrodev-1.18.0.20131218202447 lib/tasks/test_task.rb
fog-maestrodev-1.18.0.20131209091424 lib/tasks/test_task.rb
fog-maestrodev-1.18.0.20131209090811 lib/tasks/test_task.rb
fog-maestrodev-1.18.0.20131206115947 lib/tasks/test_task.rb
fog-maestrodev-1.18.0.20131205181604 lib/tasks/test_task.rb
fog-maestrodev-1.18.0.20131127194823 lib/tasks/test_task.rb