(t *testing.T, stdout, containerName, containerState string, count int)
| 167 | } |
| 168 | |
| 169 | func checkServiceContainer(t *testing.T, stdout, containerName, containerState string, count int) { |
| 170 | found := 0 |
| 171 | lines := strings.SplitSeq(stdout, "\n") |
| 172 | for line := range lines { |
| 173 | if strings.Contains(line, containerName) && strings.Contains(line, containerState) { |
| 174 | found++ |
| 175 | } |
| 176 | } |
| 177 | if found == count { |
| 178 | return |
| 179 | } |
| 180 | errMessage := fmt.Sprintf("expected %d but found %d instance(s) of container %s in stoud", count, found, containerName) |
| 181 | if containerState != "" { |
| 182 | errMessage += fmt.Sprintf(" with expected state %s", containerState) |
| 183 | } |
| 184 | t.Fatalf("%s\n%s", errMessage, stdout) |
| 185 | } |
| 186 | |
| 187 | func TestScaleDownNoRecreate(t *testing.T) { |
| 188 | const projectName = "scale-down-recreated-test" |
no outgoing calls
no test coverage detected