Coordinate separate full vet pass
This commit is contained in:
@@ -1,12 +1,29 @@
|
||||
package releasekit
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
func TestCandidateRequestMapsRaceValidation(t *testing.T) {
|
||||
"gitea.maximumdirect.net/eric/ReleaseKit/internal/validation"
|
||||
)
|
||||
|
||||
func TestCandidateRequestMapsGoValidation(t *testing.T) {
|
||||
request := candidateRequest(ReleaseRequest{
|
||||
Validation: ValidationSpec{Go: GoValidationSpec{Race: true}},
|
||||
Validation: ValidationSpec{Go: GoValidationSpec{Race: true, FullVet: true}},
|
||||
})
|
||||
if !request.Validation.Race {
|
||||
t.Fatalf("candidate request validation = %#v, want race enabled", request.Validation)
|
||||
if !request.Validation.Race || !request.Validation.FullVet {
|
||||
t.Fatalf("candidate request validation = %#v, want race and full vet enabled", request.Validation)
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidationErrorPreservesGoVetIdentity(t *testing.T) {
|
||||
cause := errors.New("vet failed")
|
||||
got := convertValidationError(&validation.Failure{Check: validation.GoVet, Cause: cause})
|
||||
var validationError *ValidationError
|
||||
if !errors.As(got, &validationError) || validationError.Check != "go-vet" {
|
||||
t.Fatalf("converted error = %#v, want go-vet validation identity", got)
|
||||
}
|
||||
if !errors.Is(got, cause) {
|
||||
t.Fatalf("converted error = %v, want cause preserved", got)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user