mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
make test output more verbose if provider service is unavailable
This commit is contained in:
parent
7880a55d6a
commit
38c760a3a5
2 changed files with 8 additions and 2 deletions
4
Rakefile
4
Rakefile
|
@ -73,7 +73,7 @@ task :mock, :provider do |t, args|
|
|||
fail 'USAGE: rake mock[<provider>]'
|
||||
end
|
||||
provider = args[:provider]
|
||||
sh("export FOG_MOCK=true && bundle exec shindont tests/#{provider}")
|
||||
sh("export FOG_MOCK=true PROVIDER=#{provider} && bundle exec shindont tests/#{provider}")
|
||||
end
|
||||
|
||||
desc 'Run live tests against a specific provider'
|
||||
|
@ -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
|
||||
|
|
|
@ -39,6 +39,12 @@ available_providers = Fog.available_providers.map {|provider| provider.downcase}
|
|||
|
||||
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)
|
||||
|
|
Loading…
Reference in a new issue