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:
Daniel Azuma 2018-08-22 13:42:05 -07:00 committed by GitHub
parent 24be95a758
commit 406fcb0032
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 3 deletions

1
.gitignore vendored
View File

@ -12,6 +12,7 @@ specdoc
wiki
.google-api.yaml
*.log
tmp/
#IntelliJ
.idea

View File

@ -20,6 +20,7 @@ group :development do
gem 'os', '~> 0.9'
gem 'rmail', '~> 1.1'
gem 'redis', '~> 3.2'
gem 'logging', '~> 2.2'
end
platforms :jruby do

View File

@ -99,7 +99,7 @@ module Google
# NotFound, etc
auth_tries = (try == 1 && authorization_refreshable? ? 2 : 1)
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
execute_once(client).tap do |result|
if block_given?

View File

@ -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'))
discovery = File.read(File.join(FIXTURES_DIR, 'files', 'test_api.json'))
generated_files = generator.render(discovery)
puts generator.dump_api_names
# puts generator.dump_api_names
tempdir = Dir.mktmpdir
generated_files.each do |key, content|
puts content
# puts content
path = File.join(tempdir, key)
FileUtils.mkdir_p(File.dirname(path))
File.open(path, 'w') do |f|