Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestIAMMalformedEndpoint fails on Go 1.14 beta1 #1225

Closed
eclipseo opened this issue Feb 9, 2020 · 3 comments
Closed

TestIAMMalformedEndpoint fails on Go 1.14 beta1 #1225

eclipseo opened this issue Feb 9, 2020 · 3 comments

Comments

@eclipseo
Copy link

eclipseo commented Feb 9, 2020

Fedora Rawhide witg Go 1.14 beta1:

Testing    in: /builddir/build/BUILD/minio-go-6.0.47/_build/src
         PATH: /builddir/build/BUILD/minio-go-6.0.47/_build/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin
       GOPATH: /builddir/build/BUILD/minio-go-6.0.47/_build:/usr/share/gocode
  GO111MODULE: off
      command: go test -buildmode pie -compiler gc -ldflags "-X github.com/minio/minio-go/version=6.0.47 -extldflags '-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '"
      testing: github.com/minio/minio-go
github.com/minio/minio-go/pkg/credentials
--- FAIL: TestIAMMalformedEndpoint (0.00s)
    iam_aws_test.go:139: Expected parse %%%%: invalid URL escape "%%%", got parse "%%%%": invalid URL escape "%%%"
FAIL
exit status 1
FAIL	github.com/minio/minio-go/pkg/credentials	0.014s

This is due to golang/go@64cfe9f and golang/go#29261

@vadmeste
Copy link
Member

@eclipseo thanks for reporting this. I guess we can change a little bit the test to make it works with 1.14 and previous versions. Could you send a PR for that ?

@harshavardhana
Copy link
Member

I think we should stop comparing error strings @vadmeste they are not meant to be compared, unless they are typed and we know exactly what to look for.

Probably we can look for url.EscapeError type but not look for the string, because those strings can change.

@vadmeste
Copy link
Member

Yes, it looks like testing this way is enough:

       ee := url.EscapeError("")
       if !errors.As(err, &ee) {
               t.Fatalf("Expected invalid URL escape error, got %s", err)
       }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants