Enable race testing in validation
This commit is contained in:
@@ -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}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user