testing

No test coverage when tests are in a different package

怎甘沉沦 提交于 2020-11-27 17:45:40
问题 I have integration tests which are located in a separate directory. Those tests run my http server in the same process via net/http/httptest. My tests run but I get no coverage. Here is a very simplified example not using http for brevity. Directory layout: $GOPATH/src/go-test hello hello.go itest integration_test.go hello.go package hello func Hello() string { return "hello" } integration_test.go package itest import ( "go-test/hello" "testing" ) func TestHello(t *testing.T) { s := hello

No test coverage when tests are in a different package

被刻印的时光 ゝ 提交于 2020-11-27 17:22:17
问题 I have integration tests which are located in a separate directory. Those tests run my http server in the same process via net/http/httptest. My tests run but I get no coverage. Here is a very simplified example not using http for brevity. Directory layout: $GOPATH/src/go-test hello hello.go itest integration_test.go hello.go package hello func Hello() string { return "hello" } integration_test.go package itest import ( "go-test/hello" "testing" ) func TestHello(t *testing.T) { s := hello

No test coverage when tests are in a different package

a 夏天 提交于 2020-11-27 17:21:12
问题 I have integration tests which are located in a separate directory. Those tests run my http server in the same process via net/http/httptest. My tests run but I get no coverage. Here is a very simplified example not using http for brevity. Directory layout: $GOPATH/src/go-test hello hello.go itest integration_test.go hello.go package hello func Hello() string { return "hello" } integration_test.go package itest import ( "go-test/hello" "testing" ) func TestHello(t *testing.T) { s := hello

No test coverage when tests are in a different package

眉间皱痕 提交于 2020-11-27 17:19:37
问题 I have integration tests which are located in a separate directory. Those tests run my http server in the same process via net/http/httptest. My tests run but I get no coverage. Here is a very simplified example not using http for brevity. Directory layout: $GOPATH/src/go-test hello hello.go itest integration_test.go hello.go package hello func Hello() string { return "hello" } integration_test.go package itest import ( "go-test/hello" "testing" ) func TestHello(t *testing.T) { s := hello

No test coverage when tests are in a different package

主宰稳场 提交于 2020-11-27 17:17:13
问题 I have integration tests which are located in a separate directory. Those tests run my http server in the same process via net/http/httptest. My tests run but I get no coverage. Here is a very simplified example not using http for brevity. Directory layout: $GOPATH/src/go-test hello hello.go itest integration_test.go hello.go package hello func Hello() string { return "hello" } integration_test.go package itest import ( "go-test/hello" "testing" ) func TestHello(t *testing.T) { s := hello

No test coverage when tests are in a different package

别等时光非礼了梦想. 提交于 2020-11-27 17:13:53
问题 I have integration tests which are located in a separate directory. Those tests run my http server in the same process via net/http/httptest. My tests run but I get no coverage. Here is a very simplified example not using http for brevity. Directory layout: $GOPATH/src/go-test hello hello.go itest integration_test.go hello.go package hello func Hello() string { return "hello" } integration_test.go package itest import ( "go-test/hello" "testing" ) func TestHello(t *testing.T) { s := hello