-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
all: replace os.Setenv with T.Setenv in tests #45448
Comments
There seems to be an issue in |
Change https://golang.org/cl/310030 mentions this issue: |
Change https://golang.org/cl/310031 mentions this issue: |
Change https://golang.org/cl/310032 mentions this issue: |
In the end there were only a few cases where |
Updates #45448 Change-Id: I570e9894c4976d0a875388ef9ea4a2aa31b78013 Reviewed-on: https://go-review.googlesource.com/c/go/+/310031 Trust: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Updates #45448 Change-Id: Ic096fe1c58c124fb8d84ee15c9446e7ed060b24f Reviewed-on: https://go-review.googlesource.com/c/go/+/310032 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Michael Knyszek <mknyszek@google.com>
Updates #45448 Change-Id: I4d8e5d7e57818355ef2bc33b57ddf9c8b8da3e62 Reviewed-on: https://go-review.googlesource.com/c/go/+/310030 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Michael Knyszek <mknyszek@google.com>
Change https://golang.org/cl/310212 mentions this issue: |
Updates #45448 Change-Id: I2e79ae6b9cf43a481aa703578712619ea344e421 Reviewed-on: https://go-review.googlesource.com/c/go/+/310212 Trust: Damien Neil <dneil@google.com> Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
TB.Setenv
was added recently, but no changes have been submitted to update the tests.Here is a list of all tests using
os.Setenv
(obtained usinggrep -F -l "os.Setenv" **/*_test.go
):std
cmd
For the
cmd
module, however, no tests actually restore the original environment variable, so I will not touch them.For the
std
module I plan to only useT.Setenv
on this pattern:There are some other cases like:
I'm not sure if
T.Setenv
should be used in a sub test.There are a few case when the environment variables are not restored, like
testing/testing_test.go
andnet/http/transport_test.go
, but probably it is ok.The text was updated successfully, but these errors were encountered: