(t *testing.T, got []byte, wantFile string)
| 213 | } |
| 214 | |
| 215 | func compareGraphs(t *testing.T, got []byte, wantFile string) { |
| 216 | wantFile = filepath.Join("testdata", wantFile) |
| 217 | want, err := os.ReadFile(wantFile) |
| 218 | if err != nil { |
| 219 | t.Fatalf("error reading test file %s: %v", wantFile, err) |
| 220 | } |
| 221 | |
| 222 | if string(got) != string(want) { |
| 223 | d, err := proftest.Diff(got, want) |
| 224 | if err != nil { |
| 225 | t.Fatalf("error finding diff: %v", err) |
| 226 | } |
| 227 | t.Errorf("Compose incorrectly wrote %s", string(d)) |
| 228 | if *updateFlag { |
| 229 | err := os.WriteFile(wantFile, got, 0644) |
| 230 | if err != nil { |
| 231 | t.Errorf("failed to update the golden file %q: %v", wantFile, err) |
| 232 | } |
| 233 | } |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | func TestNodeletCountCapping(t *testing.T) { |
| 238 | labelTags := make(TagMap) |
no test coverage detected
searching dependent graphs…