mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-18 04:54:54 +00:00
Merge pull request #134277 from lalitc375/devex
Improve developer experience for DV tests
This commit is contained in:
@@ -222,7 +222,7 @@ func verifyValidationEquivalence(t *testing.T, expectedErrs field.ErrorList, run
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("without declarative validation", func(t *testing.T) {
|
||||
t.Run("hand written validation", func(t *testing.T) {
|
||||
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DeclarativeValidationTakeover, false)
|
||||
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DeclarativeValidation, false)
|
||||
imperativeErrs = runValidations()
|
||||
@@ -234,6 +234,11 @@ func verifyValidationEquivalence(t *testing.T, expectedErrs field.ErrorList, run
|
||||
}
|
||||
})
|
||||
|
||||
if t.Failed() {
|
||||
// There is no point in moving forward, if any of above tests failed for any reason. Running follow up tests will return noise.
|
||||
t.SkipNow()
|
||||
}
|
||||
|
||||
// The equivalenceMatcher is used to verify the output errors from hand-written imperative validation
|
||||
// are equivalent to the output errors when DeclarativeValidationTakeover is enabled.
|
||||
equivalenceMatcher := field.ErrorMatcher{}.ByType().ByField().ByOrigin()
|
||||
|
||||
Reference in New Issue
Block a user