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

Function TestPreStart_PerReplicaRejected

pkg/compose/pre_start_test.go:136–152  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

134}
135
136func TestPreStart_PerReplicaRejected(t *testing.T) {
137 tested, _ := newPreStartTestService(t)
138
139 project := &types.Project{Name: "demo"}
140 service := types.ServiceConfig{
141 Name: "web",
142 Image: "alpine",
143 PreStart: []types.ServiceHook{
144 {Image: "alpine", Command: types.ShellCommand{"true"}, PerReplica: true},
145 },
146 }
147 ctr := container.Summary{ID: "service-ctr-id"}
148
149 err := tested.runPreStart(t.Context(), project, service, ctr, func(api.ContainerEvent) {})
150 assert.ErrorContains(t, err, `service "web" pre_start[0]`)
151 assert.ErrorContains(t, err, "per_replica is not yet supported")
152}
153
154func TestPreStart_ImageFallsBackToBuiltImage(t *testing.T) {
155 tested, apiClient := newPreStartTestService(t)

Callers

nothing calls this directly

Calls 2

newPreStartTestServiceFunction · 0.85
runPreStartMethod · 0.80

Tested by

no test coverage detected