-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Address Faraday warnings #149
Conversation
|
||
assert_output nil, warning do | ||
entry_point.connection.use :instrumentation | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole test will stop working on Faraday >= 1.0. Since this is going to be a breaking change Hyperclient may need to lock the Faraday version to < 1.0.0
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean no, we should make the minimum faraday version be 1.0 or test against multiple versions of Faraday and make this conditional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting a bit off-topic, but just a couple of PRs for Faraday 1.0 and I don't think this is going to be a smooth upgrade:
- Fix compatibility with Faraday 1.0 lostisland/faraday_middleware#194
- Relax Faraday dependency constraints bhaberer/faraday-digestauth#12
Even with these branches manually pulled in, I got 25 test failures:
Results of rake test
$ rake test
Run options: --seed 30217
# Running:
.............F.......EE....F.....F....EEEE......EE.........EE....................................EE.......FEE..........EEEEEE...........F.
Fabulous run in 0.082381s, 1675.1435 runs/s, 2597.6864 assertions/s.
1) Failure:
Hyperclient::EntryPoint::inherited::connection#test_0003_creates a Faraday connection with the default block plus any additional handlers [/Users/yuki/GitHub/hyperclient/test/hyperclient/entry_point_test.rb:185]:
Expected [Faraday::Response::RaiseError, FaradayMiddleware::FollowRedirects, FaradayMiddleware::EncodeHalJson, FaradayMiddleware::ParseHalJson, FaradayMiddleware::OAuth] to include Faraday::Adapter::NetHttp.
2) Error:
Hyperclient::Link::_head#test_0001_sends a HEAD request with the link url:
RuntimeError: No such handler: nil
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:243:in `assert_index'
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:135:in `swap'
/Users/yuki/GitHub/hyperclient/test/test_helper.rb:11:in `stub_request'
/Users/yuki/GitHub/hyperclient/test/hyperclient/link_test.rb:184:in `block (3 levels) in <module:Hyperclient>'
3) Error:
Hyperclient::Link::_resource#test_0001_builds a resource with the link href representation:
RuntimeError: No such handler: nil
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:243:in `assert_index'
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:135:in `swap'
/Users/yuki/GitHub/hyperclient/test/test_helper.rb:11:in `stub_request'
/Users/yuki/GitHub/hyperclient/test/hyperclient/link_test.rb:138:in `block (3 levels) in <module:Hyperclient>'
4) Failure:
Hyperclient::EntryPoint::default::connection#test_0005_creates a Faraday connection with the default block [/Users/yuki/GitHub/hyperclient/test/hyperclient/entry_point_test.rb:48]:
Expected [Faraday::Response::RaiseError, FaradayMiddleware::FollowRedirects, FaradayMiddleware::EncodeHalJson, FaradayMiddleware::ParseHalJson] to include Faraday::Adapter::NetHttp.
5) Failure:
Hyperclient::EntryPoint::default::connection#test_0004_can insert additional middleware after a connection has been constructed [/Users/yuki/GitHub/hyperclient/test/hyperclient/entry_point_test.rb:33]:
In stderr.
--- expected
+++ actual
@@ -1,2 +1 @@
-"WARNING: Unexpected middleware set after the adapter. This won't be supported from Faraday 1.0.
-"
+""
6) Error:
Hyperclient::Link::method_missing::delegation#test_0002_can handle false values in the response:
RuntimeError: No such handler: nil
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:243:in `assert_index'
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:135:in `swap'
/Users/yuki/GitHub/hyperclient/test/test_helper.rb:11:in `stub_request'
/Users/yuki/GitHub/hyperclient/test/hyperclient/link_test.rb:289:in `block (4 levels) in <module:Hyperclient>'
7) Error:
Hyperclient::Link::method_missing::delegation#test_0001_delegates when link key matches:
RuntimeError: No such handler: nil
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:243:in `assert_index'
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:135:in `swap'
/Users/yuki/GitHub/hyperclient/test/test_helper.rb:11:in `stub_request'
/Users/yuki/GitHub/hyperclient/test/hyperclient/link_test.rb:278:in `block (4 levels) in <module:Hyperclient>'
8) Error:
Hyperclient::Link::method_missing::delegation#test_0003_doesn't delegate when link key doesn't match:
RuntimeError: No such handler: nil
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:243:in `assert_index'
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:135:in `swap'
/Users/yuki/GitHub/hyperclient/test/test_helper.rb:11:in `stub_request'
/Users/yuki/GitHub/hyperclient/test/hyperclient/link_test.rb:299:in `block (4 levels) in <module:Hyperclient>'
9) Error:
Hyperclient::Link::method_missing::delegation#test_0004_backtracks when navigating links:
RuntimeError: No such handler: nil
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:243:in `assert_index'
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:135:in `swap'
/Users/yuki/GitHub/hyperclient/test/test_helper.rb:11:in `stub_request'
/Users/yuki/GitHub/hyperclient/test/hyperclient/link_test.rb:310:in `block (4 levels) in <module:Hyperclient>'
10) Error:
Hyperclient::Link::_options#test_0001_sends a OPTIONS request with the link url:
RuntimeError: No such handler: nil
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:243:in `assert_index'
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:135:in `swap'
/Users/yuki/GitHub/hyperclient/test/test_helper.rb:11:in `stub_request'
/Users/yuki/GitHub/hyperclient/test/hyperclient/link_test.rb:172:in `block (3 levels) in <module:Hyperclient>'
11) Error:
Hyperclient::Link::_delete#test_0001_sends a DELETE request with the link url:
RuntimeError: No such handler: nil
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:243:in `assert_index'
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:135:in `swap'
/Users/yuki/GitHub/hyperclient/test/test_helper.rb:11:in `stub_request'
/Users/yuki/GitHub/hyperclient/test/hyperclient/link_test.rb:196:in `block (3 levels) in <module:Hyperclient>'
12) Error:
Hyperclient::Link::_patch#test_0001_sends a PATCH request with the link url and params:
RuntimeError: No such handler: nil
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:243:in `assert_index'
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:135:in `swap'
/Users/yuki/GitHub/hyperclient/test/test_helper.rb:11:in `stub_request'
/Users/yuki/GitHub/hyperclient/test/hyperclient/link_test.rb:248:in `block (3 levels) in <module:Hyperclient>'
13) Error:
Hyperclient::Link::_patch#test_0002_defaults params to an empty hash:
RuntimeError: No such handler: nil
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:243:in `assert_index'
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:135:in `swap'
/Users/yuki/GitHub/hyperclient/test/test_helper.rb:11:in `stub_request'
/Users/yuki/GitHub/hyperclient/test/hyperclient/link_test.rb:256:in `block (3 levels) in <module:Hyperclient>'
14) Error:
Hyperclient::Link::_put#test_0001_sends a PUT request with the link url and params:
RuntimeError: No such handler: nil
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:243:in `assert_index'
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:135:in `swap'
/Users/yuki/GitHub/hyperclient/test/test_helper.rb:11:in `stub_request'
/Users/yuki/GitHub/hyperclient/test/hyperclient/link_test.rb:228:in `block (3 levels) in <module:Hyperclient>'
15) Error:
Hyperclient::Link::_put#test_0002_defaults params to an empty hash:
RuntimeError: No such handler: nil
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:243:in `assert_index'
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:135:in `swap'
/Users/yuki/GitHub/hyperclient/test/test_helper.rb:11:in `stub_request'
/Users/yuki/GitHub/hyperclient/test/hyperclient/link_test.rb:236:in `block (3 levels) in <module:Hyperclient>'
16) Failure:
Hyperclient::new::with an optional block#test_0003_creates a Faraday connection with the default block plus any additional handlers [/Users/yuki/GitHub/hyperclient/test/hyperclient_test.rb:39]:
Expected [Faraday::Response::RaiseError, FaradayMiddleware::FollowRedirects, FaradayMiddleware::EncodeHalJson, FaradayMiddleware::ParseHalJson, FaradayMiddleware::OAuth] to include Faraday::Adapter::NetHttp.
17) Error:
Hyperclient::Link::get#test_0001_sends a GET request with the link url:
RuntimeError: No such handler: nil
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:243:in `assert_index'
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:135:in `swap'
/Users/yuki/GitHub/hyperclient/test/test_helper.rb:11:in `stub_request'
/Users/yuki/GitHub/hyperclient/test/hyperclient/link_test.rb:150:in `block (3 levels) in <module:Hyperclient>'
18) Error:
Hyperclient::Link::get#test_0002_raises exceptions by default:
RuntimeError: No such handler: nil
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:243:in `assert_index'
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:135:in `swap'
/Users/yuki/GitHub/hyperclient/test/test_helper.rb:11:in `stub_request'
/Users/yuki/GitHub/hyperclient/test/hyperclient/link_test.rb:160:in `block (3 levels) in <module:Hyperclient>'
19) Error:
Hyperclient::Link::_post#test_0001_sends a POST request with the link url and params:
RuntimeError: No such handler: nil
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:243:in `assert_index'
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:135:in `swap'
/Users/yuki/GitHub/hyperclient/test/test_helper.rb:11:in `stub_request'
/Users/yuki/GitHub/hyperclient/test/hyperclient/link_test.rb:208:in `block (3 levels) in <module:Hyperclient>'
20) Error:
Hyperclient::Link::_post#test_0002_defaults params to an empty hash:
RuntimeError: No such handler: nil
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:243:in `assert_index'
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:135:in `swap'
/Users/yuki/GitHub/hyperclient/test/test_helper.rb:11:in `stub_request'
/Users/yuki/GitHub/hyperclient/test/hyperclient/link_test.rb:216:in `block (3 levels) in <module:Hyperclient>'
21) Error:
Hyperclient::Link::method_missing::resource#test_0002_raises an error when the method does not exist in the resource:
RuntimeError: No such handler: nil
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:243:in `assert_index'
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:135:in `swap'
/Users/yuki/GitHub/hyperclient/test/test_helper.rb:11:in `stub_request'
/Users/yuki/GitHub/hyperclient/test/hyperclient/link_test.rb:320:in `block (4 levels) in <module:Hyperclient>'
22) Error:
Hyperclient::Link::method_missing::resource#test_0004_does not delegate to_ary to resource:
RuntimeError: No such handler: nil
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:243:in `assert_index'
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:135:in `swap'
/Users/yuki/GitHub/hyperclient/test/test_helper.rb:11:in `stub_request'
/Users/yuki/GitHub/hyperclient/test/hyperclient/link_test.rb:320:in `block (4 levels) in <module:Hyperclient>'
23) Error:
Hyperclient::Link::method_missing::resource#test_0001_delegates unkown methods to the resource:
RuntimeError: No such handler: nil
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:243:in `assert_index'
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:135:in `swap'
/Users/yuki/GitHub/hyperclient/test/test_helper.rb:11:in `stub_request'
/Users/yuki/GitHub/hyperclient/test/hyperclient/link_test.rb:320:in `block (4 levels) in <module:Hyperclient>'
24) Error:
Hyperclient::Link::method_missing::resource#test_0003_responds to missing methods:
RuntimeError: No such handler: nil
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:243:in `assert_index'
/Users/yuki/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/rack_builder.rb:135:in `swap'
/Users/yuki/GitHub/hyperclient/test/test_helper.rb:11:in `stub_request'
/Users/yuki/GitHub/hyperclient/test/hyperclient/link_test.rb:320:in `block (4 levels) in <module:Hyperclient>'
25) Failure:
Hyperclient::EntryPoint::custom::connection#test_0003_creates a Faraday connection with the default block [/Users/yuki/GitHub/hyperclient/test/hyperclient/entry_point_test.rb:151]:
Expected [FaradayMiddleware::EncodeJson, FaradayMiddleware::ParseJson] to include Faraday::Adapter::NetHttp.
138 runs, 214 assertions, 5 failures, 20 errors, 0 skips
rake aborted!
Command failed with status (1)
Tasks: TOP => test
(See full trace by running task with --trace)
ecf5ad2
to
0014bc5
Compare
Changelog missing a period at the end. |
There is a warning message from Faraday, suggesting that :
It seems like strting version 1.0 Faraday no longer will allow for setting middleware once the adapter is set: lostisland/faraday#685, so I moved the bock call into the
default_faraday_block
lambda.