mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Merge pull request #34643 from mbohlool/h2o
Automatic merge from submit-queue Enable OpenAPI spec validation Spec validation was failing on Jenkins. I am enabling it in this PR to figure out if we can get it pass. No review is necessary until all test passes.
This commit is contained in:
commit
98a2808b94
@ -353,21 +353,14 @@ func TestValidOpenAPISpec(t *testing.T) {
|
|||||||
assert.NoError(res.AsError())
|
assert.NoError(res.AsError())
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(mehdy): The actual validation part of these tests are timing out on jerkin but passing locally. Enable it after debugging timeout issue.
|
|
||||||
disableValidation := true
|
|
||||||
|
|
||||||
// Validate OpenApi spec
|
// Validate OpenApi spec
|
||||||
doc, err := loads.Spec(server.URL + "/swagger.json")
|
doc, err := loads.Spec(server.URL + "/swagger.json")
|
||||||
if assert.NoError(err) {
|
if assert.NoError(err) {
|
||||||
validator := validate.NewSpecValidator(doc.Schema(), strfmt.Default)
|
validator := validate.NewSpecValidator(doc.Schema(), strfmt.Default)
|
||||||
if !disableValidation {
|
|
||||||
res, warns := validator.Validate(doc)
|
res, warns := validator.Validate(doc)
|
||||||
assert.NoError(res.AsError())
|
assert.NoError(res.AsError())
|
||||||
if !warns.IsValid() {
|
if !warns.IsValid() {
|
||||||
t.Logf("Open API spec on root has some warnings : %v", warns)
|
t.Logf("Open API spec on root has some warnings : %v", warns)
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
t.Logf("Validation is disabled because it is timing out on jenkins put passing locally.")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user