1
我正在尝试使用Gikngo来为appengine编写一些测试。Gikngo测试在goapp测试期间挂起
我为测试设置如下:
suite_test.go:
BeforeSuite() {
inst, err = aetest.NewInstance(options)
if err != nil {
Fail(fmt.Sprintf("%s", err))
}
}
var(
req *http.Request
ctx context.Context
)
BeforeEach() {
req = inst.NewRequest()
ctx = appengine.NewContext(req)
// Clean up local datastore using the context.
}
validation_test.go
Describe("Some Test", func() {
It("ValidateFoo", func() {
// Access ctx here
})
...
It("ValidateBar", func() {
// Access ctx here.
})
})
我看到我们的测试中始终与类型的错误挂:
Expected success, but got an error:
<*url.Error | 0xc8210570b0>: {
Op: "Post",
URL: "http://localhost:59072",
Err: {s: "EOF"},
}
Post http://localhost:59072: EOF
这似乎表明API服务器已变得无法访问。但是,测试输出似乎没有指出这一点。
我们可以调试goapp测试的方式有哪些?