File tree Expand file tree Collapse file tree 2 files changed +3
-28
lines changed
Expand file tree Collapse file tree 2 files changed +3
-28
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,6 @@ import (
1616 "github.com/moby/moby/api/types"
1717 "github.com/moby/moby/api/types/container"
1818 "github.com/moby/moby/client"
19- "github.com/moby/moby/client/pkg/progress"
20- "github.com/moby/moby/client/pkg/streamformatter"
2119 "github.com/spf13/pflag"
2220 "gotest.tools/v3/assert"
2321 is "gotest.tools/v3/assert/cmp"
@@ -245,20 +243,12 @@ func TestRunPullTermination(t *testing.T) {
245243 _ = server .Close ()
246244 })
247245 go func () {
248- id := test .RandomID ()[:12 ] // short-ID
249- progressOutput := streamformatter .NewJSONProgressOutput (server , true )
250- for i := range 100 {
246+ for range 100 {
251247 select {
252248 case <- ctx .Done ():
253249 assert .NilError (t , server .Close (), "failed to close imageCreateFunc server" )
254250 return
255251 default :
256- assert .NilError (t , progressOutput .WriteProgress (progress.Progress {
257- ID : id ,
258- Message : "Downloading" ,
259- Current : int64 (i ),
260- Total : 100 ,
261- }))
262252 time .Sleep (100 * time .Millisecond )
263253 }
264254 }
Original file line number Diff line number Diff line change 77 "time"
88
99 "github.com/docker/cli/cli/streams"
10- "github.com/docker/cli/internal/test"
11- "github.com/moby/moby/client/pkg/progress"
12- "github.com/moby/moby/client/pkg/streamformatter"
1310 "gotest.tools/v3/assert"
1411)
1512
@@ -23,23 +20,12 @@ func TestDisplay(t *testing.T) {
2320 })
2421
2522 go func () {
26- id := test .RandomID ()[:12 ] // short-ID
27- progressOutput := streamformatter .NewJSONProgressOutput (server , true )
28- for i := range 100 {
23+ for range 100 {
2924 select {
3025 case <- ctx .Done ():
3126 assert .NilError (t , server .Close (), "failed to close jsonmessage server" )
3227 return
3328 default :
34- err := progressOutput .WriteProgress (progress.Progress {
35- ID : id ,
36- Message : "Downloading" ,
37- Current : int64 (i ),
38- Total : 100 ,
39- })
40- if err != nil {
41- break
42- }
4329 time .Sleep (100 * time .Millisecond )
4430 }
4531 }
@@ -50,8 +36,7 @@ func TestDisplay(t *testing.T) {
5036
5137 done := make (chan error )
5238 go func () {
53- out := streams .NewOut (io .Discard )
54- done <- Display (streamCtx , client , out )
39+ done <- Display (streamCtx , client , streams .NewOut (io .Discard ))
5540 }()
5641
5742 cancelStream ()
You can’t perform that action at this time.
0 commit comments