Add logging to gemfile to fix specs (#707)
* Add logging to gemfile to fix specs * Get rid of huge puts in the generator test that was overwhelming travis * Fix HTTP tests by making the new Signet::RemoteServerError retriable
This commit is contained in:
parent
24be95a758
commit
406fcb0032
|
@ -12,6 +12,7 @@ specdoc
|
||||||
wiki
|
wiki
|
||||||
.google-api.yaml
|
.google-api.yaml
|
||||||
*.log
|
*.log
|
||||||
|
tmp/
|
||||||
|
|
||||||
#IntelliJ
|
#IntelliJ
|
||||||
.idea
|
.idea
|
||||||
|
|
1
Gemfile
1
Gemfile
|
@ -20,6 +20,7 @@ group :development do
|
||||||
gem 'os', '~> 0.9'
|
gem 'os', '~> 0.9'
|
||||||
gem 'rmail', '~> 1.1'
|
gem 'rmail', '~> 1.1'
|
||||||
gem 'redis', '~> 3.2'
|
gem 'redis', '~> 3.2'
|
||||||
|
gem 'logging', '~> 2.2'
|
||||||
end
|
end
|
||||||
|
|
||||||
platforms :jruby do
|
platforms :jruby do
|
||||||
|
|
|
@ -99,7 +99,7 @@ module Google
|
||||||
# NotFound, etc
|
# NotFound, etc
|
||||||
auth_tries = (try == 1 && authorization_refreshable? ? 2 : 1)
|
auth_tries = (try == 1 && authorization_refreshable? ? 2 : 1)
|
||||||
Retriable.retriable tries: auth_tries,
|
Retriable.retriable tries: auth_tries,
|
||||||
on: [Google::Apis::AuthorizationError, Signet::AuthorizationError],
|
on: [Google::Apis::AuthorizationError, Signet::AuthorizationError, Signet::RemoteServerError],
|
||||||
on_retry: proc { |*| refresh_authorization } do
|
on_retry: proc { |*| refresh_authorization } do
|
||||||
execute_once(client).tap do |result|
|
execute_once(client).tap do |result|
|
||||||
if block_given?
|
if block_given?
|
||||||
|
|
|
@ -27,10 +27,10 @@ RSpec.describe Google::Apis::Generator do
|
||||||
generator = Google::Apis::Generator.new(api_names: File.join(FIXTURES_DIR, 'files', 'api_names.yaml'))
|
generator = Google::Apis::Generator.new(api_names: File.join(FIXTURES_DIR, 'files', 'api_names.yaml'))
|
||||||
discovery = File.read(File.join(FIXTURES_DIR, 'files', 'test_api.json'))
|
discovery = File.read(File.join(FIXTURES_DIR, 'files', 'test_api.json'))
|
||||||
generated_files = generator.render(discovery)
|
generated_files = generator.render(discovery)
|
||||||
puts generator.dump_api_names
|
# puts generator.dump_api_names
|
||||||
tempdir = Dir.mktmpdir
|
tempdir = Dir.mktmpdir
|
||||||
generated_files.each do |key, content|
|
generated_files.each do |key, content|
|
||||||
puts content
|
# puts content
|
||||||
path = File.join(tempdir, key)
|
path = File.join(tempdir, key)
|
||||||
FileUtils.mkdir_p(File.dirname(path))
|
FileUtils.mkdir_p(File.dirname(path))
|
||||||
File.open(path, 'w') do |f|
|
File.open(path, 'w') do |f|
|
||||||
|
|
Loading…
Reference in New Issue