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: tests fails when run from a module (or with a go.work file) that uses go1.23+ #70082

Closed
findleyr opened this issue Oct 28, 2024 · 2 comments
Assignees
Labels
Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@findleyr
Copy link
Member

Various x/tools tests fail when run from a module that has go1.23 in its go directive, or (more likely) when using a go.work file that says go1.23, because the tests themselves assume go1.22 semantics.

In particular, tests of the internal/aliases package that assume a default GODEBUG value for gotypesalias are broken.

> cat go.mod
module mod.test

go 1.24

require golang.org/x/tools v0.26.1-0.20241028184645-73d6794ebbd4
> go test golang.org/x/tools/internal/aliases
--- FAIL: TestNewAlias (0.00s)
    --- FAIL: TestNewAlias/#00 (0.00s)
        aliases_test.go:77: Expected A.Type() to not be a types.Alias(). got "p.A"
FAIL
FAIL    golang.org/x/tools/internal/aliases     0.018s
FAIL

I think we should relax these assertions, since they are not valid in all testing scenarios.

CC @timothy-king @adonovan @pjweinb

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Oct 28, 2024
@gopherbot gopherbot added this to the Unreleased milestone Oct 28, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/622896 mentions this issue: all: fix x/tools tests that fail with a go1.23.1 go.work file

apstndb pushed a commit to apstndb/gotoolsdiff that referenced this issue Jan 11, 2025
Delete or selectively skip tests that made either of the following
assumptions:
- The default GODEBUG is that of Go 1.22 (not true given a go.work
  file).
- GOROOT is a development version of Go (not true if GOROOT is prepared
  by cmd/distpack).

Fixes golang/go#70081
Fixes golang/go#70082

Change-Id: I47dfb225427f75e3be833eed3ba677ff454935f1
Reviewed-on: https://go-review.googlesource.com/c/tools/+/622896
Reviewed-by: Alan Donovan <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
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

3 participants