MCPcopy
hub / github.com/docker/compose / TestApplyScaleOpt

Function TestApplyScaleOpt

cmd/compose/up_test.go:57–81  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

55var _ loader.ResourceLoader = testRemoteLoader{}
56
57func TestApplyScaleOpt(t *testing.T) {
58 p := types.Project{
59 Services: types.Services{
60 "foo": {
61 Name: "foo",
62 },
63 "bar": {
64 Name: "bar",
65 Deploy: &types.DeployConfig{
66 Mode: "test",
67 },
68 },
69 },
70 }
71 err := applyScaleOpts(&p, []string{"foo=2", "bar=3"})
72 assert.NilError(t, err)
73 foo, err := p.GetService("foo")
74 assert.NilError(t, err)
75 assert.Equal(t, *foo.Scale, 2)
76
77 bar, err := p.GetService("bar")
78 assert.NilError(t, err)
79 assert.Equal(t, *bar.Scale, 3)
80 assert.Equal(t, *bar.Deploy.Replicas, 3)
81}
82
83func TestUpOptions_OnExit(t *testing.T) {
84 tests := []struct {

Callers

nothing calls this directly

Calls 1

applyScaleOptsFunction · 0.85

Tested by

no test coverage detected