Check expected publication push URL
This commit is contained in:
@@ -114,7 +114,8 @@ func TestCheckCommandBindsConfiguredChecksToCapturedCandidate(t *testing.T) {
|
||||
|
||||
func TestCandidateRequestMapsGoValidation(t *testing.T) {
|
||||
request := candidateRequest(cli.Invocation{Repository: "repository", Version: "v1.2.3"}, cli.Settings{
|
||||
Product: "Example Product",
|
||||
Product: "Example Product",
|
||||
ExpectedPushURL: "publication-only value",
|
||||
Validation: &cli.ValidationSettings{
|
||||
Go: cli.GoValidationSettings{Race: true, FullVet: true, CompileTargets: []string{"linux/amd64", "darwin/arm64"}},
|
||||
},
|
||||
@@ -122,6 +123,9 @@ func TestCandidateRequestMapsGoValidation(t *testing.T) {
|
||||
if !request.Validation.Go.Race || !request.Validation.Go.FullVet {
|
||||
t.Fatalf("candidate request validation = %#v, want Go race and full vet enabled", request.Validation)
|
||||
}
|
||||
if request.ExpectedPushURL != "" {
|
||||
t.Fatalf("candidate request carried publication-only expected push URL %q", request.ExpectedPushURL)
|
||||
}
|
||||
wantTargets := []releasekit.Target{{OS: "linux", Arch: "amd64"}, {OS: "darwin", Arch: "arm64"}}
|
||||
if len(request.Validation.Go.CompileTargets) != len(wantTargets) {
|
||||
t.Fatalf("candidate request compile targets = %#v, want %#v", request.Validation.Go.CompileTargets, wantTargets)
|
||||
@@ -217,9 +221,11 @@ printf '%s %s\n' "$version" "$candidate" >> "$RELEASEKIT_COMPATIBILITY_LOG"
|
||||
cliGitRun(t, repository, "add", "docs/releases/v1.2.3.md", "scripts/check-release-note.sh")
|
||||
cliGitRun(t, repository, "commit", "-m", "add compatibility note and check")
|
||||
checkLog := filepath.Join(t.TempDir(), "compatibility-check.log")
|
||||
remote := filepath.Join(t.TempDir(), "origin.git")
|
||||
settings := cli.Settings{
|
||||
Product: "Example Product",
|
||||
Remote: "origin",
|
||||
Product: "Example Product",
|
||||
Remote: "origin",
|
||||
ExpectedPushURL: remote,
|
||||
Checks: []cli.CheckCommand{{
|
||||
Args: []string{"sh", "scripts/check-release-note.sh"},
|
||||
Env: map[string]string{"RELEASEKIT_COMPATIBILITY_LOG": checkLog},
|
||||
@@ -237,7 +243,6 @@ printf '%s %s\n' "$version" "$candidate" >> "$RELEASEKIT_COMPATIBILITY_LOG"
|
||||
}
|
||||
cliGitRun(t, repository, "add", "releasekit.json")
|
||||
cliGitRun(t, repository, "commit", "-m", "configure source release")
|
||||
remote := filepath.Join(t.TempDir(), "origin.git")
|
||||
cliGitRun(t, repository, "init", "--bare", remote)
|
||||
cliGitRun(t, repository, "remote", "add", "origin", remote)
|
||||
cliGitRun(t, repository, "push", "--set-upstream", "origin", "main")
|
||||
|
||||
Reference in New Issue
Block a user