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:
Kubernetes Submit Queue 2016-12-07 01:34:36 -08:00 committed by GitHub
commit 98a2808b94

View File

@ -353,21 +353,14 @@ func TestValidOpenAPISpec(t *testing.T) {
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
doc, err := loads.Spec(server.URL + "/swagger.json")
if assert.NoError(err) {
validator := validate.NewSpecValidator(doc.Schema(), strfmt.Default)
if !disableValidation {
res, warns := validator.Validate(doc)
assert.NoError(res.AsError())
if !warns.IsValid() {
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.")
res, warns := validator.Validate(doc)
assert.NoError(res.AsError())
if !warns.IsValid() {
t.Logf("Open API spec on root has some warnings : %v", warns)
}
}
}