(t *testing.T)
| 18 | } |
| 19 | |
| 20 | func TestGraphQLApplier(t *testing.T) { |
| 21 | tctx := prepareTestContext(t) |
| 22 | |
| 23 | t.Logf("Test ID: %s", tctx.ID) |
| 24 | t.Logf("Test Repository: %s", tctx.Repo.String()) |
| 25 | |
| 26 | createBranch(t, tctx) |
| 27 | defer cleanupBranches(t, tctx) |
| 28 | |
| 29 | patches, err := filepath.Glob(filepath.Join("testdata", "patches", "*.patch")) |
| 30 | if err != nil { |
| 31 | t.Fatalf("error listing patches: %v", err) |
| 32 | } |
| 33 | |
| 34 | t.Logf("Discovered %d patches", len(patches)) |
| 35 | for _, patch := range patches { |
| 36 | name := strings.TrimSuffix(filepath.Base(patch), ".patch") |
| 37 | t.Run(name, func(t *testing.T) { |
| 38 | runGraphQLPatchTest(t, tctx, name) |
| 39 | }) |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | func runGraphQLPatchTest(t *testing.T, tctx *TestContext, name string) { |
| 44 | f, err := os.Open(filepath.Join("testdata", "patches", name+".patch")) |
nothing calls this directly
no test coverage detected