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

x/tools/internal/testenv: stop parsing CombinedOutput #65729

Closed
adonovan opened this issue Feb 15, 2024 · 3 comments
Closed

x/tools/internal/testenv: stop parsing CombinedOutput #65729

adonovan opened this issue Feb 15, 2024 · 3 comments
Assignees
Labels
Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@adonovan
Copy link
Member

adonovan commented Feb 15, 2024

The testenv package defines a number of helpers for skipping tests. One of them checks that go env GOROOT and runtime.GOROOT agree; if not, it skips the test. (Perhaps it should fatal? But I digress.)

When running with GODEBUG=countertrace, the go env command prints a bunch of stuff to stderr, as it should. However, testenv runs the command and then gathers its CombinedOutput (2>&1), which means it is no longer a well-formed go env result. Mayhem ensues.

No Go program should attempt to parse CombinedOutput. It is for human eyes only (or tests that look for fragments of error messages among the wreckage).

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Feb 15, 2024
@gopherbot gopherbot added this to the Unreleased milestone Feb 15, 2024
@adonovan adonovan self-assigned this Feb 15, 2024
@gopherbot
Copy link

Change https://go.dev/cl/564515 mentions this issue: x/tools: don't parse CombinedOutput

@gopherbot
Copy link

Change https://go.dev/cl/564516 mentions this issue: x/tools: don't parse CombinedOutput

@gopherbot
Copy link

Change https://go.dev/cl/564339 mentions this issue: x/tools: address review of CL 564515 (CombinedOutput)

gopherbot pushed a commit to golang/tools that referenced this issue Feb 16, 2024
I fumbled with git and forked the CL, stranding some review
comments from bcmills on the ill-fated fork.

Updates golang/go#65729

Change-Id: I6d0bf431f841dacb94e9e13a90bf39f8e2ed2fbf
Reviewed-on: https://go-review.googlesource.com/c/tools/+/564339
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

2 participants