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

cmd/go, cmd/go/internal/mod{conv,fetch,load}: tests use GOPROXY from environment #30571

Closed
dmitshur opened this issue Mar 4, 2019 · 5 comments
Labels
FrozenDueToAge GoCommand cmd/go modules NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@dmitshur
Copy link
Contributor

dmitshur commented Mar 4, 2019

On tip, the following tests use the GOPROXY environment variable set in environment, and fail if it is set to a Go proxy that isn't functional:

cmd/go: TestGoGetInsecure/modules
cmd/go/internal/modconv: TestConvertLegacyConfig
cmd/go/internal/modfetch: TestCodeRepo, TestCodeRepoVersions, TestLatest
cmd/go/internal/modload: TestQuery

The typical errors is like:

--- FAIL: TestQuery/vcs-test.golang.org_git_emptytest.git/<v10.0.0/* (0.00s)
    query_test.go:141: Query("vcs-test.golang.org/git/emptytest.git", "<v10.0.0", *): unexpected status (https://example.com/proxy/vcs-test.golang.org/git/emptytest.git/@v/list): 404 Not Found, want error "no matching versions for query \"<v10.0.0\""

Can be reproduced by doing:

export GOPROXY=https://example.com/proxy
go test cmd/go/...

I suspect these tests should be controlling their own GOPROXY environment (i.e., setting it to direct). /cc @bcmills

@dmitshur dmitshur added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. GoCommand cmd/go modules labels Mar 4, 2019
@dmitshur dmitshur added this to the Go1.13 milestone Mar 4, 2019
@bcmills bcmills added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 4, 2019
@gopherbot gopherbot removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 4, 2019
@bcmills bcmills self-assigned this Mar 4, 2019
@gopherbot
Copy link

Change https://golang.org/cl/165745 mentions this issue: cmd/go: clear GOPROXY in TestGoGetInsecure

gopherbot pushed a commit that referenced this issue Mar 6, 2019
TestGoGetInsecure verifies that 'go get -insecure' can fetch a
particular package. However, the GOPROXY protocol does not provide a
means for proxies to indicate packages as insecure; thus, proxies
cannot safely serve those packages.

Updates #30571

Change-Id: I447776dff98bd8ee6eb5055b897b9c7d293e3423
Reviewed-on: https://go-review.googlesource.com/c/go/+/165745
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/167084 mentions this issue: cmd/go/internal/modload: set GOPROXY=direct and GOPATH in test

@gopherbot
Copy link

Change https://golang.org/cl/167086 mentions this issue: cmd/go: fix typo in GoGetInsecure to actually set GOPROXY

@bcmills bcmills added the Testing An issue that has been verified to require only test changes, not just a test failure. label Mar 12, 2019
gopherbot pushed a commit that referenced this issue Mar 12, 2019
I typo'd this variable in CL 165745, and neither I, the reviewer, nor the TryBots noticed.
But the longtest builder noticed, and it's not happy about it.

Updates #30571

Change-Id: I5e3d267346407855ec0d1f340a72dc2c521ecc63
Reviewed-on: https://go-review.googlesource.com/c/go/+/167086
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/199820 mentions this issue: [release-branch.go1.12] cmd/go: clear GOPROXY in TestGoGetInsecure

gopherbot pushed a commit that referenced this issue Oct 8, 2019
TestGoGetInsecure verifies that 'go get -insecure' can fetch a
particular package. However, the GOPROXY protocol does not provide a
means for proxies to indicate packages as insecure; thus, proxies
cannot safely serve those packages.

This also squashes the typo fix from CL 167086.

Updates #30571
Fixes #33758

Change-Id: I447776dff98bd8ee6eb5055b897b9c7d293e3423
Reviewed-on: https://go-review.googlesource.com/c/go/+/165745
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/c/go/+/199820
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
@gopherbot
Copy link

Change https://golang.org/cl/200037 mentions this issue: [release-branch.go1.12] cmd/go/internal/{modconv,modfetch,modload}: set modfetch proxy URL in tests

gopherbot pushed a commit that referenced this issue Oct 9, 2019
…et modfetch proxy URL in tests

Updates #30571
Fixes #34789

Change-Id: Id4c74e83ee58a080d1c2894ae5ebdbf4aeb1ce42
Reviewed-on: https://go-review.googlesource.com/c/go/+/167084
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
(cherry picked from commit bd680d9)
Reviewed-on: https://go-review.googlesource.com/c/go/+/200037
@golang golang locked and limited conversation to collaborators Oct 8, 2020
@rsc rsc unassigned bcmills Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge GoCommand cmd/go modules NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

3 participants