Keep Go package patterns usable during readiness
This commit is contained in:
@@ -151,3 +151,24 @@ func main() { if len(os.Args) == 2 && os.Args[1] == "version" { fmt.Println("fix
|
||||
t.Fatalf("calendar receipt = %+v, error = %v", receipt, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPackagePatternBuildAndReadinessAgree(t *testing.T) {
|
||||
for _, pattern := range []string{"./...", "example.com/tagged-app/..."} {
|
||||
t.Run(pattern, func(t *testing.T) {
|
||||
repo := newDeliveryBuildRepository(t)
|
||||
profile := fmt.Sprintf(`{"product":"Example Product","build":{"main_package":%q,"binary_name":"helper","targets":[%q]}}`, pattern, runtime.GOOS+"/"+runtime.GOARCH)
|
||||
writeRepositoryFile(t, repo, "releasekit.json", profile)
|
||||
cliGitRun(t, repo, "add", "releasekit.json")
|
||||
cliGitRun(t, repo, "commit", "-m", "configure main package pattern")
|
||||
var output, diagnostics bytes.Buffer
|
||||
if code := run(t.Context(), []string{"build", "--repo", repo, "--output", t.TempDir(), "v1.2.3"}, &output, &diagnostics); code != 0 {
|
||||
t.Fatalf("build code=%d error=%s", code, &diagnostics)
|
||||
}
|
||||
output.Reset()
|
||||
diagnostics.Reset()
|
||||
if code := run(t.Context(), []string{"validate", "--repo", repo, "--operation", "build", "--offline", "--json"}, &output, &diagnostics); code != 0 || !strings.Contains(output.String(), `"id":"main-package","operation":"build","status":"unchecked"`) {
|
||||
t.Fatalf("readiness code=%d report=%s error=%s", code, &output, &diagnostics)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user