seedMetadata populates the metadata index directly so search/pagination tests do not depend on live GitHub downloads.
(t *testing.T, dbPath string, n int)
| 16 | // seedMetadata populates the metadata index directly so search/pagination tests |
| 17 | // do not depend on live GitHub downloads. |
| 18 | func seedMetadata(t *testing.T, dbPath string, n int) { |
| 19 | t.Helper() |
| 20 | ctx := context.Background() |
| 21 | store := metadata.NewStore(dbPath) |
| 22 | if err := store.Init(ctx); err != nil { |
| 23 | t.Fatalf("init store: %v", err) |
| 24 | } |
| 25 | for i := range n { |
| 26 | kind := "skill" |
| 27 | itemPath := "skills/seed/SKILL.md" |
| 28 | if i%2 == 0 { |
| 29 | kind = "agent" |
| 30 | itemPath = "agents/seed.md" |
| 31 | } |
| 32 | if err := store.UpsertItem(ctx, metadata.Item{ |
| 33 | Kind: kind, |
| 34 | Name: kindName(kind, i), |
| 35 | Description: "seeded item", |
| 36 | RepoOwner: "seed", |
| 37 | RepoName: "repo", |
| 38 | RepoBranch: "main", |
| 39 | ItemPath: itemPath, |
| 40 | InstallKey: kind + "-seed-" + itoa(i), |
| 41 | TargetApps: "claude,codex", |
| 42 | }); err != nil { |
| 43 | t.Fatalf("seed upsert: %v", err) |
| 44 | } |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | func kindName(kind string, i int) string { return kind + "-seed-" + itoa(i) } |
| 49 |
no test coverage detected