Carry module identity through candidate results
This commit is contained in:
@@ -43,7 +43,7 @@ func TestCandidateOperationsPreserveCallbackValidationDiagnostics(t *testing.T)
|
||||
RepositoryDir: repo.work, Product: "Sample App", Version: "v1.2.3",
|
||||
AdditionalChecks: func(context.Context, releasekit.Candidate) error { return diagnostic },
|
||||
}
|
||||
_, checkError := releasekit.Check(t.Context(), request)
|
||||
candidate, checkError := releasekit.Check(t.Context(), request)
|
||||
result, publishError := releasekit.Publish(t.Context(), request)
|
||||
for _, err := range []error{checkError, publishError} {
|
||||
var got *releasekit.ValidationError
|
||||
@@ -56,7 +56,13 @@ func TestCandidateOperationsPreserveCallbackValidationDiagnostics(t *testing.T)
|
||||
}
|
||||
}
|
||||
}
|
||||
if candidate.ModuleDir != repo.work || candidate.ModulePath != "example.com/releasekit-publish-fixture" || candidate.Tag != "v1.2.3" || candidate.Commit != repo.commit {
|
||||
t.Fatalf("Check() callback failure candidate = %#v, want captured identity", candidate)
|
||||
}
|
||||
if result.State != releasekit.PublicationNotAttempted || result.TagObject != "" {
|
||||
t.Fatalf("callback failure publication result = %#v", result)
|
||||
}
|
||||
if result.RepositoryDir != repo.work || result.ModuleDir != repo.work || result.ModulePath != candidate.ModulePath || result.Tag != candidate.Tag || result.CandidateCommit != candidate.Commit {
|
||||
t.Fatalf("Publish() callback failure result = %#v, want captured identity", result)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user