Enable race testing in validation

This commit is contained in:
2026-10-07 22:10:34 +00:00
parent 89981abbe5
commit 30fe4fe206
20 changed files with 510 additions and 61 deletions

View File

@@ -8,9 +8,10 @@ import (
"gitea.maximumdirect.net/eric/ReleaseKit/internal/gotool"
)
// Settings selects shared validation behavior. Its zero value runs the current
// default Go suite.
type Settings struct{}
// Settings selects shared validation behavior.
type Settings struct {
Race bool
}
// Request identifies the captured source and output used by shared validation.
type Request struct {
@@ -32,8 +33,12 @@ func Run(ctx context.Context, request Request) error {
if err != nil {
return &Failure{Check: GoTest, Cause: err}
}
_, err = tool.Run(ctx, request.RepositoryDir, gotool.Native, gotool.Target{}, request.Output,
"test", "-mod=readonly", "-count=1", "./...")
args := []string{"test", "-mod=readonly", "-count=1"}
if request.Settings.Race {
args = append(args, "-race")
}
args = append(args, "./...")
_, err = tool.Run(ctx, request.RepositoryDir, gotool.Native, gotool.Target{}, request.Output, args...)
if err != nil {
return &Failure{Check: GoTest, Cause: err}
}