I'm trying to run GAE tests on multiple packages. My app (testapp ) looks as below:
testapp>
README.md package1 package2
each package has two go files. One is the package itself the other is the 'test' package.
package1
$ls package1
package1.go package1_test.go
package2
$ls package2
package2.go package2_test.go
To run the tests I use
goapp test -v ./...
Output:
warning: building out-of-date packages:
github.com/mihai/API
installing these packages with 'go test -i ./...' will speed future tests.
=== RUN TestGetDiskFile
codelistgobfile.gob
codelist.gob written successfully
--- PASS: TestGetDiskFile (0.00 seconds)
PASS
ok testapp/package1 0.010s
However as you can see above it seems to run only the first test ( TestGetDiskFile ) from package1
. After that it gets stuck. I get no kind of output. If I go in each package ( cd package 1
) and run goapp test
all the tests (about 20 tests) run successfully
Any idea how I can fix / run all the tests without getting stuck or at least how I can debug it further? is this a goapp
bug? I've tried on two different machines ( Mac osx , and ubuntu ), the result is same.
To debug, strip things down to a minimal test case. For example, the following is a minimal test case for go test -v ./...
. Try something similar for goapp test -v ./...
.
$ dir
package1 package2
$ tree ../packages
../packages
├── package1
│ └── package1_test.go
└── package2
└── package2_test.go
2 directories, 2 files
$ go test -v ./...
=== RUN TestPackage1
--- PASS: TestPackage1 (0.00 seconds)
PASS
ok packages/package1 0.004s
=== RUN TestPackage2
--- PASS: TestPackage2 (0.00 seconds)
PASS
ok packages/package2 0.004s
$
File: package1_test.go
:
package package1
import "testing"
func TestPackage1(t *testing.T) {}
File: package2_test.go
:
package package2
import "testing"
func TestPackage2(t *testing.T) {}