Skip to content

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

@dmitshur

Description

@dmitshur

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeGoCommandcmd/goNeedsFixThe path to resolution is known, but the work has not been done.TestingAn issue that has been verified to require only test changes, not just a test failure.modules

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions