Skip to content

Commit

Permalink
Merge pull request fog#2508 from allomov/test-more-verbose
Browse files Browse the repository at this point in the history
Make test output more verbose if Provider is not available for live tests.
  • Loading branch information
geemus committed Dec 26, 2013
2 parents 933944a + d480d63 commit 53e6e06
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -82,7 +82,7 @@ task :live, :provider do |t, args|
fail 'USAGE: rake live[<provider>]'
end
provider = args[:provider]
sh("export FOG_MOCK=false && bundle exec shindont tests/#{provider}")
sh("export FOG_MOCK=false PROVIDER=#{provider} && bundle exec shindont tests/#{provider}")
end

task :nuke do
Expand Down
6 changes: 6 additions & 0 deletions tests/helper.rb
Expand Up @@ -39,6 +39,12 @@ def array_differences(array_a, array_b)

unavailable_providers = all_providers - available_providers

if !ENV['PROVIDER'].nil? && unavailable_providers.include?(ENV['PROVIDER'])
Formatador.display_line("[red]Requested provider #{ENV['PROVIDER']} is not available.[/]" +
"[red]Check if .fog file has correct configuration (see '#{Fog.credentials_path}')[/]")
exit(0)
end

for provider in unavailable_providers
Formatador.display_line("[yellow]Skipping tests for [bold]#{provider}[/] [yellow]due to lacking credentials (add some to '#{Fog.credentials_path}' to run them)[/]")
Thread.current[:tags] << ('-' << provider)
Expand Down

0 comments on commit 53e6e06

Please sign in to comment.