Coordinate separate full vet pass
This commit is contained in:
@@ -130,7 +130,8 @@ type ValidationSettings struct {
|
||||
|
||||
// GoValidationSettings selects checks performed by the Go toolchain.
|
||||
type GoValidationSettings struct {
|
||||
Race bool `json:"race,omitempty"`
|
||||
Race bool `json:"race,omitempty"`
|
||||
FullVet bool `json:"full_vet,omitempty"`
|
||||
}
|
||||
|
||||
// DeliverySettings selects the hosted Gitea release destination.
|
||||
|
||||
@@ -141,10 +141,10 @@ func TestLoadSettingsDefaultsRemoteAndConfigPath(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadSettingsReadsRaceValidation(t *testing.T) {
|
||||
func TestLoadSettingsReadsGoValidation(t *testing.T) {
|
||||
repoDir := t.TempDir()
|
||||
profilePath := filepath.Join(repoDir, "releasekit.json")
|
||||
if err := os.WriteFile(profilePath, []byte(`{"product":"Example","validation":{"go":{"race":true}}}`), 0o600); err != nil {
|
||||
if err := os.WriteFile(profilePath, []byte(`{"product":"Example","validation":{"go":{"race":true,"full_vet":true}}}`), 0o600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -152,8 +152,8 @@ func TestLoadSettingsReadsRaceValidation(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if settings.Validation == nil || !settings.Validation.Go.Race {
|
||||
t.Fatalf("validation settings = %#v, want Go race enabled", settings.Validation)
|
||||
if settings.Validation == nil || !settings.Validation.Go.Race || !settings.Validation.Go.FullVet {
|
||||
t.Fatalf("validation settings = %#v, want Go race and full vet enabled", settings.Validation)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -160,7 +160,10 @@ func validationSpec(settings *cli.ValidationSettings) releasekit.ValidationSpec
|
||||
return releasekit.ValidationSpec{}
|
||||
}
|
||||
return releasekit.ValidationSpec{
|
||||
Go: releasekit.GoValidationSpec{Race: settings.Go.Race},
|
||||
Go: releasekit.GoValidationSpec{
|
||||
Race: settings.Go.Race,
|
||||
FullVet: settings.Go.FullVet,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -112,15 +112,15 @@ func TestCheckCommandBindsConfiguredChecksToCapturedCandidate(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCandidateRequestMapsRaceValidation(t *testing.T) {
|
||||
func TestCandidateRequestMapsGoValidation(t *testing.T) {
|
||||
request := candidateRequest(cli.Invocation{Repository: "repository", Version: "v1.2.3"}, cli.Settings{
|
||||
Product: "Example Product",
|
||||
Validation: &cli.ValidationSettings{
|
||||
Go: cli.GoValidationSettings{Race: true},
|
||||
Go: cli.GoValidationSettings{Race: true, FullVet: true},
|
||||
},
|
||||
}, nil)
|
||||
if !request.Validation.Go.Race {
|
||||
t.Fatalf("candidate request validation = %#v, want Go race enabled", request.Validation)
|
||||
if !request.Validation.Go.Race || !request.Validation.Go.FullVet {
|
||||
t.Fatalf("candidate request validation = %#v, want Go race and full vet enabled", request.Validation)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user