Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion tools/catalog/behaviour_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,23 @@ func TestDeterministicAndCheck(t *testing.T) {
t.Fatalf("%s registry differs between two runs on identical inputs", f)
}
}
args := tierArgs("free", filepath.Join(td, "free"), filepath.Join(d1, "free"), filepath.Join(d1, "p1l", "registry.json"), "-check")
entries, err := os.ReadDir(filepath.Join(td, "free"))
if err != nil {
t.Fatal(err)
}
var slugs []string
for _, entry := range entries {
if entry.IsDir() {
slugs = append(slugs, entry.Name())
}
}
// Give -check its own committed baseline, independent of checkout refs.
dir := tree(t, "free", slugs...)
catalogGit(t, dir, "init", "-q")
catalogGit(t, dir, "add", "releases.json")
catalogGit(t, dir, "commit", "-qm", "Release fixture")
catalogGit(t, dir, "update-ref", "refs/heads/main", "HEAD")
args := tierArgs("free", dir, filepath.Join(d1, "free"), filepath.Join(d1, "p1l", "registry.json"), "-check")
if code, se := gen(t, args...); code != 0 {
t.Fatalf("-check on current output: exit %d\n%s", code, se)
}
Expand Down
10 changes: 10 additions & 0 deletions tools/catalog/release_consistency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,13 @@ func TestCheckAllowsNewUnreleasedManifest(t *testing.T) {
t.Fatalf("new unreleased plugin: exit %d\n%s", code, se)
}
}

func TestCheckRefusesMissingMainBaseline(t *testing.T) {
dir := tree(t, "free", "ai-cli")
catalogGit(t, dir, "init", "-q", "-b", "fixture")
catalogGit(t, dir, "add", "releases.json")
catalogGit(t, dir, "commit", "-qm", "Release fixture")
args := tierArgs("free", dir, t.TempDir(), "")
mustGen(t, args...)
expectProblem(t, "-check needs origin/main or main", append(args, "-check")...)
}
Loading