Add structured validation failures

This commit is contained in:
2026-10-07 18:27:36 +00:00
parent 1de7555b3e
commit 136a97fb6c
6 changed files with 162 additions and 5 deletions

View File

@@ -3,7 +3,6 @@ package validation
import (
"context"
"fmt"
"io"
"gitea.maximumdirect.net/eric/ReleaseKit/internal/gotool"
@@ -25,9 +24,12 @@ type Request struct {
func Run(ctx context.Context, request Request) error {
tool, err := gotool.New(ctx, request.RepositoryDir)
if err != nil {
return fmt.Errorf("prepare Go toolchain: %w", err)
return &Failure{Check: GoTest, Cause: err}
}
_, err = tool.Run(ctx, request.RepositoryDir, gotool.Native, gotool.Target{}, request.Output,
"test", "-mod=readonly", "-count=1", "./...")
return err
if err != nil {
return &Failure{Check: GoTest, Cause: err}
}
return nil
}