-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
testing: go test -n is missing the creation of _testmain.go #66592
Comments
Change https://go.dev/cl/574698 mentions this issue: |
@golang/tools-team I am not sure it makes sense to have a strong commitment to ensuring that "go build/test -n" output produces a script that has the exact same semantics as the build itself - I am sure I have seen other places similar to this where the trace output is not perfectly reflective of reality. If we want to do this we would need a lot more testing, perhaps a builder that would lock down this behavior (otherwise it would break as the Go tool evolved). This doesn't seem (at least to me) like a good use of team resources. Go tools folks should have the final call however. |
@thanm I agree that it shouldn't be a super high priority for us to ensure the script is perfect, but -n is a feature of go build/test that we say we support in the documentation, so it seems to me that we should try to make an effort to keep it accurate? edit: I can see the argument in the other direction-- the help test says that we print the commands run, and I guess it's debatable whether producing the testmain file is one of the "commands" that we run, but we seem to print out entries for the other inputs that we produce to the other commands. |
@matloob that works for me-- if you and the other Go command owners are happy with the proposed fix so am I, thanks :-) |
Sounds good. We'll move forward with the review. |
Go version
go1.21.5
Output of
go env
in your module/workspace:What did you do?
Running the following commands:
... should reproduce the same effect as running
go test
normally.What did you see happen?
The command building the test binary fails to find
_testmain.go
What did you expect to see?
The compile command should have succeeded.
This is happening because the writing of the _testmain.go file is directly done by go test rather than done via an action.
The text was updated successfully, but these errors were encountered: