MCPcopy Create free account
hub / github.com/docker/cli / testUpdaterNoOrder

Method testUpdaterNoOrder

cli/command/service/progress/progress_test.go:45–57  ·  view source on GitHub ↗
(tasks []swarm.Task, expectedConvergence bool, expectedProgress []progress.Progress)

Source from the content-addressed store, hash-verified

43}
44
45func (u updaterTester) testUpdaterNoOrder(tasks []swarm.Task, expectedConvergence bool, expectedProgress []progress.Progress) {
46 u.p.clear()
47 converged, err := u.updater.update(u.service, tasks, u.activeNodes, u.rollback)
48 assert.Check(u.t, err)
49 assert.Check(u.t, is.Equal(expectedConvergence, converged))
50
51 // instead of checking that expected and actual match exactly, verify that
52 // they are the same length, and every time from actual is in expected.
53 assert.Check(u.t, is.Equal(len(expectedProgress), len(u.p.p)))
54 for _, prog := range expectedProgress {
55 assert.Check(u.t, is.Contains(u.p.p, prog))
56 }
57}
58
59func TestReplicatedProgressUpdaterOneReplica(t *testing.T) {
60 replicas := uint64(1)

Callers 1

Calls 3

ContainsMethod · 0.80
updateMethod · 0.65
clearMethod · 0.45

Tested by

no test coverage detected