- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我有以下 Ginkgo
测试文件:
package foo
import (
"log"
. "github.com/onsi/ginkgo"
)
var _ = BeforeSuite(func() {
log.Print("BeforeSuite")
})
var _ = AfterSuite(func() {
log.Print("AfterSuite")
})
var _ = Describe("Foo", func() {
log.Print("Describe")
})
当我运行 ginkgo -r -v
时,测试文件运行,但 BeforeSuite
和 AfterSuite
似乎没有:
2016/03/16 09:23:17 Describe
testing: warning: no tests to run
PASS
行 2016/03/16 09:23:17 Describe
显示 Describe
正在运行,但是 BeforeSuite
的输出在哪里> 和 AfterSuite
?
我并不真正关心输出,但在我的实际测试中(不是上面的片段),数据库的建立和拆除没有得到执行。
我做错了什么?
最佳答案
您没有调用 RunSpecs
func TestSo(t *testing.T) {
RunSpecs(t, "My Test Suite")
}
然后输出类似于
2016/03/16 07:16:05 Describe
Running Suite: So Suite
=======================
Random Seed: 1458137764
Will run 0 of 0 specs
2016/03/16 07:16:05 BeforeSuite
2016/03/16 07:16:05 AfterSuite
Ran 0 of 0 Specs in 0.000 seconds
SUCCESS! -- 0 Passed | 0 Failed | 0 Pending | 0 Skipped PASS
Ginkgo ran 1 suite in 1.211144437s
Test Suite Passed
您是否尝试在 _suite_test.go
文件中运行您的实际测试?
关于go - Golang Ginkgo BeforeSuite 没有输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36037244/
当我运行 go get -u github.com/onsi/ginkgo/ginkgo 直到昨天我没有任何问题。特别是 fsnotify输出如下 00:52:08 go: downloading g
我已经使用 Ginkgo 一段时间了,我发现了一个我不太理解的行为。我有一组规范,当且仅当条件可用时,我才想运行这些规范。如果条件不可用,我想跳过测试套件。 像这样: ginkgo.Before
首先,我想告诉你,我是 go 的新手,而且我来自 Python。话虽如此,我可以继续解决我的问题。我遇到了以下问题: cacciald@cacciald-Lenovo-G470:~/workspace
我继承了一个 Go 项目,该项目由许多常用文件、各种库、两个可执行文件和理论上的测试套件组成。测试套件是在事后编写的。但我不喜欢我发现的唯一设置方式相当难吃 我正在使用 Ginkgo,这是我的起始目录
我正在尝试使用 Gikngo为应用引擎编写一些测试。 我的测试设置如下: suite_test.go: BeforeSuite() { inst, err = aetest.NewInstance
我有以下 Ginkgo测试文件: package foo import ( "log" . "github.com/onsi/ginkgo" ) var _ = BeforeSuite
我使用 Shippable 作为我的 CI,我的项目基于 Go 1.11。所有单元测试都是使用 Ginkgo 和 Gomega 以 BDD 风格编写的。在我的测试管道中,我有类似的东西: gocov
我有一个在 Travis CI 中构建的 GO 项目。我已经使用 Ginkgo 实现了一些测试,当我在本地运行它时我获得了代码覆盖率,但是当我在 Travis 上运行它时我没有得到覆盖率。 我的.tr
在使用 Ginkgo 框架编写测试时,我注意到按 C-c 终止正在运行的套件会产生误报。 note the green "1 Passed" 当您查看代码时,您会注意到此测试应在 5 秒后失败。当我在
在这里,我正在尝试在 go 命令行应用程序上执行 BDD。我正在使用 Ginkgo,它包装了 testing.go 并让你做更具表现力的 BDD。 https://github.com/onsi/gi
我正在评估 ginkgo目前 - 我非常喜欢 BDD 风格。 但是,我目前无法让 VS Code 调试器与框架一起工作。官方的 VS-Code 扩展为使用 CodeLens 的 native Go 测
我正在使用 Ginkgo 来执行一些运行时间相对较长的集成测试。穿插在我的测试输出中的是偶尔警告我的测试执行时间太长: • [SLOW TEST:30.000 seconds] 在通过标准 Go 测试
我正在用 ginkgo 重写我们的 k8s Controller 的单元测试。 和以前的 TDD 一样,对于每个测试,我们都会有类似的东西。 // Create the Channel ob
我的 Go 应用程序(restfull api 服务)正在增长,我决定使用测试。我的选择是 Ginkgo/Gomega。 学习网站 ( http://onsi.github.io/ginkgo/#ge
我正在使用 Ginkgo(和 Gomega)包对 Go(lang) Rest API 进行单元测试。 我需要使用全局设置,这应该可以通过定义来实现 var _ = BeforeSuite(func()
我刚开始学习为 http 请求编写单元测试,我浏览了几个博客,但我不明白如何使用 Ginkgo 为此编写测试。 func getVolDetails(volName string, obj inter
我是一名优秀的程序员,十分优秀!