go-openapi / validate

openapi toolkit validation helpers
Apache License 2.0
115 stars 53 forks source link

Multiple test failures with Go 1.16 beta 1 #139

Closed eclipseo closed 3 years ago

eclipseo commented 3 years ago

On Fedora Rawhide with Go 1.16 beta 1, the following tests fails:

Testing    in: /builddir/build/BUILD/validate-0.20.0/_build/src
         PATH: /builddir/build/BUILD/validate-0.20.0/_build/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin
       GOPATH: /builddir/build/BUILD/validate-0.20.0/_build:/usr/share/gocode
  GO111MODULE: off
      command: go test -buildmode pie -compiler gc -ldflags " -X github.com/go-openapi/validate/version=0.20.0 -extldflags '-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld  '"
      testing: github.com/go-openapi/validate
github.com/go-openapi/validate
--- FAIL: TestStringItemsValidation (0.00s)
    items_validator_test.go:180: 
            Error Trace:    items_validator_test.go:180
            Error:          Error message not equal:
                            expected: "tags.1 in query must be of type string: \"null\""
                            actual  : "tags.1 in query should be at least 3 chars long"
            Test:           TestStringItemsValidation
--- FAIL: TestStringParameterValidation (0.00s)
    parameter_validator_test.go:152: 
            Error Trace:    parameter_validator_test.go:152
            Error:          Error message not equal:
                            expected: "name in query must be of type string: \"null\""
                            actual  : "name in query is required"
            Test:           TestStringParameterValidation
--- FAIL: Test_Issue1621 (1.34s)
    messages_test.go:435: 
            Error Trace:    messages_test.go:435
                                        spec_test.go:660
            Error:          "[/v4/clusters/{cluster_id}/.examples.kubernetes_version in body must be of type string: "null"]" should have 0 item(s), but has 1
            Test:           Test_Issue1621
    messages_test.go:436: Returned warnings:
    messages_test.go:438: /v4/clusters/{cluster_id}/.examples.kubernetes_version in body must be of type string: "null"
FAIL
exit status 1
FAIL    github.com/go-openapi/validate  18.998s 
eclipseo commented 3 years ago

It's because I use a newer github.com/go-openapi/errors Closing.

eclipseo commented 3 years ago

Actually I use the correct one, version 0.19.9

fredbi commented 3 years ago

@eclipseo a recent commit was supposed to address go1.16 specifics, in particular affecting the required check: https://github.com/go-openapi/validate/pull/138

Can you reproduce your issue with v0.20.0? (just before that commit)

eclipseo commented 3 years ago

I was using 0.20.0, it seems to be fixed with 0.20.1 indeed.

Thank you.