Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests are run twice for hybrid _test packages #112

Open
Invertisment opened this issue Jul 25, 2019 · 1 comment
Open

Tests are run twice for hybrid _test packages #112

Invertisment opened this issue Jul 25, 2019 · 1 comment

Comments

@Invertisment
Copy link

Invertisment commented Jul 25, 2019

Golang allows placing two packages into one folder if one of them has _test suffix.
It runs normally for default kind of tests but when I try to use gocheck in the same manner my tests get run twice.

I've created a sample repository for this bug:
https://github.com/Invertisment/gocheck-test-package-bug

This is the output of my test suite:

go test -v ./...
=== RUN   Test
OK: 1 passed
--- PASS: Test (0.00s)
PASS
ok  	_____/double-test/gocheck_one_package	0.010s
=== RUN   Test
OK: 2 passed
--- PASS: Test (0.00s)
=== RUN   Test
OK: 2 passed
--- PASS: Test (0.00s)
PASS
ok  	_____/double-test/gocheck_two_packages_one_folder	0.007s
=== RUN   TestOnePackage
--- PASS: TestOnePackage (0.00s)
PASS
ok  	_____/double-test/one_package	0.009s
=== RUN   TestTwoInOneMain
--- PASS: TestTwoInOneMain (0.00s)
=== RUN   TestTwoInOneTestPackage
--- PASS: TestTwoInOneTestPackage (0.00s)
PASS
ok  	_____/double-test/two_packages_one_folder	0.001s
@robert-zaremba
Copy link

Hi, I've sold this problem in the following PR:
Invertisment/gocheck-test-package-bug#1

You can find a reason of the double test run in the commit description. Basically gocheck test registration (TestingT) was run twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants