Carry module identity through candidate results
This commit is contained in:
@@ -37,7 +37,7 @@ func TestPublishPushesOnlyTheCapturedAnnotatedTag(t *testing.T) {
|
||||
if readErr != nil || string(runs) != "ran\n" {
|
||||
return fmt.Errorf("standard suite runs before additional checks: contents=%q error=%v", runs, readErr)
|
||||
}
|
||||
if candidate.RepositoryDir != repo.work || candidate.Commit != commit || candidate.Version != "v1.2.3" {
|
||||
if candidate.RepositoryDir != repo.work || candidate.ModuleDir != repo.work || candidate.ModulePath != "example.com/releasekit-publish-fixture" || candidate.Tag != "v1.2.3" || candidate.Commit != commit || candidate.Version != "v1.2.3" {
|
||||
t.Fatalf("callback candidate = %#v", candidate)
|
||||
}
|
||||
return nil
|
||||
@@ -58,7 +58,7 @@ func TestPublishPushesOnlyTheCapturedAnnotatedTag(t *testing.T) {
|
||||
if result.State != releasekit.PublicationPublished || result.Phase != releasekit.PublicationComplete {
|
||||
t.Fatalf("publication result = %#v", result)
|
||||
}
|
||||
if result.CandidateCommit != commit || result.Endpoint != repo.bare || result.TagObject == "" {
|
||||
if result.RepositoryDir != repo.work || result.ModuleDir != repo.work || result.ModulePath != "example.com/releasekit-publish-fixture" || result.Tag != "v1.2.3" || result.CandidateCommit != commit || result.Endpoint != repo.bare || result.TagObject == "" {
|
||||
t.Fatalf("publication identity = %#v", result)
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ func requireRacePrerequisites(t *testing.T) {
|
||||
func TestCheckReturnsPublicValidationError(t *testing.T) {
|
||||
repo := newPublishFixture(t)
|
||||
t.Setenv("RELEASEKIT_FAIL_FIXTURE_SUITE", "1")
|
||||
_, err := releasekit.Check(context.Background(), releasekit.ReleaseRequest{
|
||||
captured, err := releasekit.Check(context.Background(), releasekit.ReleaseRequest{
|
||||
RepositoryDir: repo.work,
|
||||
Product: "Sample App",
|
||||
Version: "v1.2.3",
|
||||
@@ -300,6 +300,9 @@ func TestCheckReturnsPublicValidationError(t *testing.T) {
|
||||
if !errors.Is(err, exitErr) {
|
||||
t.Fatal("Check() error does not preserve the Go process error identity")
|
||||
}
|
||||
if captured.RepositoryDir != repo.work || captured.ModuleDir != repo.work || captured.ModulePath != "example.com/releasekit-publish-fixture" || captured.Tag != "v1.2.3" || captured.Commit != repo.commit || captured.Version != "v1.2.3" {
|
||||
t.Fatalf("Check() failure candidate = %#v, want captured identity alongside validation error", captured)
|
||||
}
|
||||
}
|
||||
|
||||
func TestMarkdownValidationRunsThroughCheckAndPublish(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user