(t *testing.T)
| 134 | } |
| 135 | |
| 136 | func 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 | |
| 154 | func TestPreStart_ImageFallsBackToBuiltImage(t *testing.T) { |
| 155 | tested, apiClient := newPreStartTestService(t) |
nothing calls this directly
no test coverage detected