Completely remove deprecated d.NewClient from testing tools#38686
Completely remove deprecated d.NewClient from testing tools#38686thaJeztah merged 1 commit intomoby:masterfrom
d.NewClient from testing tools#38686Conversation
|
oh, hm.. looks like this needs some changes; |
612dc96 to
4ffbed5
Compare
|
Oops. Pushed an update to fix. |
4ffbed5 to
820d710
Compare
Favor `d.NewClientT` instead. Signed-off-by: Brian Goff <[email protected]>
820d710 to
e063099
Compare
Codecov Report
@@ Coverage Diff @@
## master #38686 +/- ##
==========================================
- Coverage 36.56% 36.53% -0.03%
==========================================
Files 610 610
Lines 45395 45395
==========================================
- Hits 16598 16587 -11
- Misses 26505 26510 +5
- Partials 2292 2298 +6 |
|
Ok, all green. Want to double-check? |
thaJeztah
left a comment
There was a problem hiding this comment.
left one question that I wasn't entirely sure of, but otherwise still looks sane to me
| return f(c, t) | ||
| func withClient(t assert.TestingT, d *Daemon, f func(client.APIClient, poll.LogT) poll.Result) func(poll.LogT) poll.Result { | ||
| return func(pt poll.LogT) poll.Result { | ||
| c := d.NewClientT(t) |
There was a problem hiding this comment.
Wondering if there's a need to use poll.Error here? In that case perhaps we should inline ~ what NewClientT does here
| c := d.NewClientT(t) | |
| if ht, ok := t.(test.HelperT); ok { | |
| ht.Helper() | |
| } | |
| c, err := client.NewClientWithOpts( | |
| client.FromEnv, | |
| client.WithHost(d.Sock())) | |
| if err != nil { | |
| poll.Error(err) | |
| } |
There was a problem hiding this comment.
NewClientT will mark the build as fail (and fatal), so I'm pretty sure it will get out of the poll loop in case of failure… but I'm not 100% sure about that.
cc @dnephin
There was a problem hiding this comment.
Ya, that sounds right. t.Fatal will panic and stop execution.
Favor
d.NewClientTinstead.