PaloAltoNetworks / a3s

Auth As A Service
Apache License 2.0
8 stars 5 forks source link

make test fails on master #40

Closed sseeeff closed 2 years ago

sseeeff commented 2 years ago

Describe the bug

Platform: Mac OS

Failures:

  * /Users/sseeeff/workspace/code/go/src/github.com/PaloAltoNetworks/a3s/pkgs/gwutils/gwutils_test.go
  Line 71:
  Expected: 'tls: failed to parse certificate from server: x509: malformed certificate'
  Actual:   'tls: failed to parse certificate from server: asn1: structure error: tags don't match (16 vs {class:1 tag:7 length:97 isCompound:true}) {optional:false explicit:false application:false private:false defaultValue:<nil> tag:<nil> stringType:0 timeType:0 set:false omitEmpty:false} certificate @2'
  (Should be equal)
  goroutine 34 [running]:
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/smartystreets/goconvey@v1.6.4/convey/reporting/reports.go:143 +0x7b
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/smartystreets/goconvey@v1.6.4/convey/reporting/reports.go:103 +0xbc
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/smartystreets/goconvey@v1.6.4/convey/context.go:176 +0x233
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/smartystreets/goconvey@v1.6.4/convey/doc.go:125 +0x71
  go.aporeto.io/a3s/pkgs/gwutils.TestMakeTLSPeerCertificateVerifier.func1.2()
    /Users/sseeeff/workspace/code/go/src/github.com/PaloAltoNetworks/a3s/pkgs/gwutils/gwutils_test.go:71 +0x25a
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/smartystreets/goconvey@v1.6.4/convey/discovery.go:80 +0x3e
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/smartystreets/goconvey@v1.6.4/convey/context.go:261 +0x232
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/smartystreets/goconvey@v1.6.4/convey/context.go:163 +0xa9
  github.com/jtolds/gls.(*ContextManager).SetValues.func1(0x0)
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/jtolds/gls@v4.20.0+incompatible/context.go:97 +0x5cb
  github.com/jtolds/gls.EnsureGoroutineId(0xc00033e180)
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/jtolds/gls@v4.20.0+incompatible/gid.go:19 +0x1b9
  github.com/jtolds/gls.(*ContextManager).SetValues(0xc00019ca80, 0xc00033e120, 0xc00034c000)
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/jtolds/gls@v4.20.0+incompatible/context.go:63 +0x285
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/smartystreets/goconvey@v1.6.4/convey/context.go:162 +0x359
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/smartystreets/goconvey@v1.6.4/convey/doc.go:77 +0xb1
  go.aporeto.io/a3s/pkgs/gwutils.TestMakeTLSPeerCertificateVerifier.func1()
    /Users/sseeeff/workspace/code/go/src/github.com/PaloAltoNetworks/a3s/pkgs/gwutils/gwutils_test.go:68 +0x47b
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/smartystreets/goconvey@v1.6.4/convey/discovery.go:80 +0x3e
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/smartystreets/goconvey@v1.6.4/convey/context.go:261 +0x232
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/smartystreets/goconvey@v1.6.4/convey/context.go:110 +0x1d8
  github.com/jtolds/gls.(*ContextManager).SetValues.func1(0x0)
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/jtolds/gls@v4.20.0+incompatible/context.go:97 +0x5cb
  github.com/jtolds/gls.EnsureGoroutineId.func1()
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/jtolds/gls@v4.20.0+incompatible/gid.go:24 +0x46
  github.com/jtolds/gls._m(0x0, 0xc0001aa120)
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/jtolds/gls@v4.20.0+incompatible/stack_tags.go:108 +0x43
  github.com/jtolds/gls.github_com_jtolds_gls_markS(0x0, 0xc0001aa120)
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/jtolds/gls@v4.20.0+incompatible/stack_tags.go:56 +0x45
  github.com/jtolds/gls.addStackTag(...)
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/jtolds/gls@v4.20.0+incompatible/stack_tags.go:49
  github.com/jtolds/gls.EnsureGoroutineId(0xc0001992f0)
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/jtolds/gls@v4.20.0+incompatible/gid.go:24 +0x176
  github.com/jtolds/gls.(*ContextManager).SetValues(0xc00019ca80, 0xc000199290, 0xc0001a0640)
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/jtolds/gls@v4.20.0+incompatible/context.go:63 +0x285
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/smartystreets/goconvey@v1.6.4/convey/context.go:105 +0x465
    /Users/sseeeff/workspace/code/go/pkg/mod/github.com/smartystreets/goconvey@v1.6.4/convey/doc.go:75 +0xe5
  go.aporeto.io/a3s/pkgs/gwutils.TestMakeTLSPeerCertificateVerifier(0xc000182480)
    /Users/sseeeff/workspace/code/go/src/github.com/PaloAltoNetworks/a3s/pkgs/gwutils/gwutils_test.go:46 +0x105
  testing.tRunner(0xc000182480, 0x1a354c8)
    /usr/local/go/src/testing/testing.go:1193 +0x203
  created by testing.(*T).Run
    /usr/local/go/src/testing/testing.go:1238 +0x5d8

15 total assertions

--- FAIL: TestMakeTLSPeerCertificateVerifier (0.02s)

Possible solution

Check error as StartsWith "tls: failed to parse certificate from server: "

primalmotion commented 2 years ago

You probably have an older version of go, but yes we could just match the error prefix

sseeeff commented 2 years ago

How do we document this ?

primalmotion commented 2 years ago

it;s not a matter of documentation, it's more like macos sometimes has different output messages than when running on linux. I think we should simply prefix match here