Verify versioned contracts and exact offline distribution selection

This commit is contained in:
2026-11-29 04:35:26 +00:00
parent 053219b8da
commit e2e86a0a71
5 changed files with 184 additions and 43 deletions

View File

@@ -16,7 +16,7 @@ func TestDistributionDocuments(t *testing.T) {
root := os.DirFS("../..")
for _, required := range []string{
"README.md", "AGENTS.md", "LICENSE", "COPYRIGHT", "VERSION", "go.mod", "go.sum",
"docs/party.md", "docs/campaign.md", "docs/glossary.md", "docs/validation.md",
"catalog.json", "docs/catalog.md", "docs/validation.md",
"docs/compatibility.md", "docs/development.md", "docs/release.md", "docs/inventory.md",
"docs/oss/attribution.md", "scripts/check.sh", ".woodpecker.yml",
} {
@@ -24,6 +24,16 @@ func TestDistributionDocuments(t *testing.T) {
t.Errorf("required distribution content %s: %v", required, err)
}
}
set := loadSet(t)
for _, record := range set.Catalog.Schemas {
if _, err := fs.Stat(root, path.Join(path.Dir(record.Path), "semantics.md")); err != nil {
t.Error(err)
}
entries, err := fs.ReadDir(root, path.Join(path.Dir(record.Path), "examples"))
if err != nil || len(entries) == 0 {
t.Errorf("%s missing examples: %v", record.Path, err)
}
}
version, err := fs.ReadFile(root, "VERSION")
if err != nil {
t.Fatal(err)