简体   繁体   English

简单测试失败

[英]Convey fail on simple test

I am attempting to use Convey for the first time. 我正在尝试第一次使用Convey。 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. 更新:我在另一个运行正常的应用程序中发现了一个旧的Convey测试。 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. 它是同一台服务器,然后进行安装。

测试屏幕截图

It may be related to your version of Go combined with your (outdated) version of Go Convey and some of its dependencies. 它可能与您的Go版本,您的(过时的)Go Convey版本及其某些依赖项相关。 Perhaps you had some dependencies already in your $GOPATH/src and now you updated to Go version 1.12.*? 也许您在$GOPATH/src已经有一些依赖项,现在您已更新到Go版本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 从Go版本1.10升级到Go版本1.12.6时,这发生在我身上,我已经遵循此处的详细信息,这有助于我修复环境: 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 这应该等效于: 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 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 这应该等效于: go get github.com/jtolds/gls

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM