scionproto / scion

SCION Internet Architecture
https://scion.org
Apache License 2.0
391 stars 160 forks source link

Go: go version 1.12.x breaks goconvey tests #3009

Closed karampok closed 4 years ago

karampok commented 5 years ago

When trying to set up a local workspace of scion from scratch I observed that using go version 1.12 breaks the local go test ./... because goconvey panics.

scion (master %) cd go/lib/log/                                                                                                              
log (master %) go test ./...                                                                                                                 

0 total assertions                                                                                                                                                                                                                                                                         

--- FAIL: TestLoggerCtxEmbedding (0.00s)                                                                                                                                                                                                                                                   
panic: Top-level calls to Convey(...) need a reference to the *testing.T.                                                                    
                Hint: Convey("description here", t, func() { /* notice that the second argument was the *testing.T (t)! */ })  [recovered]                                                                                                                                                 
        panic: Top-level calls to Convey(...) need a reference to the *testing.T.                                                                                                                                                                                                          
                Hint: Convey("description here", t, func() { /* notice that the second argument was the *testing.T (t)! */ })  [recovered]   
        panic: Top-level calls to Convey(...) need a reference to the *testing.T.                                                                                                                                                                                                          
                Hint: Convey("description here", t, func() { /* notice that the second argument was the *testing.T (t)! */ })                                                                                                                                                              

goroutine 5 [running]:                                                                                                                                                                                                                                                                     
testing.tRunner.func1(0xc0000ce100)                                                                                                          
        /usr/local/go/src/testing/testing.go:830 +0x392                                                                                      
panic(0x59c520, 0xc00008e930)                                                                                                                
        /usr/local/go/src/runtime/panic.go
...

There are a couple of issues around

cc @Oncilla

wyp2013 commented 5 years ago

I have the same problem

oncilla commented 5 years ago

Hi @wyp2013 Because of this issue (and some other incompatibilities), we currently require go1.11.x. Our build system, bazel, takes this into account: https://github.com/scionproto/scion/blob/b07042263775dc5b29a76a04fd5e08a2731ef615/WORKSPACE#L19

If you want to use the default go tool chain, make sure to use go version 11.

We are working on phasing the incompatible code out as we go, e.g. we want to replace all code using goconvey. However, I cannot give an exact timeline when this will be finished.

rubycut commented 4 years ago

I installed go 1.13.3 with gvm, installed goconvey on top of empty pkg and src dirs and my tests work.