简单测试失败

I am attempting to use Convey for the first time. My real test fails for an unknown reason, so I created this very simple test and it fails the same way.

   GO Convey
func TestSimple(t *testing.T) {
    Convey("Given Simple Test", t, func() {
        Convey("When Tested", func() {
            Convey("There should be a result", func() {
                i := 1
                So(i, ShouldEqual, i)
            })
        })
    })
}

I am probably doing something wrong, however I'm at a loss

UPDATE: I found an old Convey test in another app that works. I copied the simple test to it and ran tests. it works.

Is there something that is possibly configured wrong? It is the same server and go setup.

Screen shot of test

It may be related to your version of Go combined with your (outdated) version of Go Convey and some of its dependencies. Perhaps you had some dependencies already in your $GOPATH/src and now you updated to Go version 1.12.*?

This happened to me when updating from Go version 1.10 to Go version 1.12.6, I've followed the details in here and this helped me fixing my environment: https://github.com/smartystreets/goconvey/issues/561#issuecomment-505525085

These are the steps I followed:

  • cd $GOPATH/src/github.com/smartystreets/goconvey/ && git checkout master && git pull
    • this should be equivalent to: go get github.com/smartystreets/goconvey
  • cd $GOPATH/src/github.com/smartystreets/assertions/ && git checkout master && git pull
    • this should be equivalent to: go get github.com/smartystreets/assertions
  • go get -u golang.org/x/tools...
  • cd $GOPATH/src/github.com/jtolds/gls/ && git checkout master && git pull
    • this should be equivalent to: go get github.com/jtolds/gls