Skip to content

go test ./... does not detect tests in submodules of multimodule projects #59476

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

Closed
cyrusv opened this issue Apr 7, 2023 · 1 comment
Closed

Comments

@cyrusv
Copy link

cyrusv commented Apr 7, 2023

What version of Go are you using (go version)?

1.20.1

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

amd64

What did you do?

go test ./... documentation specifies that it will find all subpackages. Documentation leads to believe that all test files will be executed. However, test files in a submodule of a multi-module project are ignored.

This is especially shocking when your CICD is counting on go test ./..., and you add a v2 submodule.

People work around it like this: https://stackoverflow.com/questions/61163306/running-go-test-in-parent-directory-of-multiple-go-modules

Either this is a bug that should be fixed (happy to open a PR with some guidance), or the documentation should be updated to specify the expected behavior in submodule/multimodule case.

@seankhliao
Copy link
Member

Duplicate of #27957

@seankhliao seankhliao marked this as a duplicate of #27957 Apr 7, 2023
@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Apr 7, 2023
@golang golang locked and limited conversation to collaborators Apr 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants