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/build: run subrepo tests from outside their repositories #34352

Open
bcmills opened this issue Sep 17, 2019 · 2 comments

Comments

@bcmills
Copy link
Member

commented Sep 17, 2019

(This is essentially the golang.org/x/[…] version of #30316.)

go.mod files in testdata directories cut off the directory from the rest of the module (see #27852). As a result, the corresponding tests are likely to fail.

Unfortunately, at least one of the golang.org/x repos already includes such files: I am aware of some in golang.org/x/tools/go/packages/testdata (CC @heschik, @matloob), and there may be others as well.

Rather than expecting all Go developers to remember to avoid adding extraneous go.mod files, we should configure builders and TryBots to run the tests for golang.org/x modules outside the module, either in addition to or instead of running them from within a cloned repository.


(The simplest alternative I am aware of is to construct a symlink overlay within a temporary directory, as is done in various misc/cgo tests.)

CC @dmitshur @toothrot @bradfitz

@gopherbot

This comment has been minimized.

Copy link

commented Sep 18, 2019

Change https://golang.org/cl/196258 mentions this issue: go/packages: remove go.mod files

gopherbot pushed a commit to golang/tools that referenced this issue Sep 18, 2019
Files named go.mod define a module boundary and punch a hole in the
repository when the module is fetched with go get. We had a couple in
testdata. Get rid of them.

In one case the changes I made to produce a module cache in packagestest
were enough. In the other, the test needs multiple minor/patch versions
of the same module, which we have no provision for. Rename them to
"definitelynot_go.mod" in the repo and fix it up in the test.

Updates golang/go#34352

Change-Id: I284578b3aebb0f1fec3ddb4bef0df24f050d0636
Reviewed-on: https://go-review.googlesource.com/c/tools/+/196258
Run-TryBot: Heschi Kreinick <heschi@google.com>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
clintjedwards added a commit to clintjedwards/tools that referenced this issue Sep 19, 2019
Files named go.mod define a module boundary and punch a hole in the
repository when the module is fetched with go get. We had a couple in
testdata. Get rid of them.

In one case the changes I made to produce a module cache in packagestest
were enough. In the other, the test needs multiple minor/patch versions
of the same module, which we have no provision for. Rename them to
"definitelynot_go.mod" in the repo and fix it up in the test.

Updates golang/go#34352

Change-Id: I284578b3aebb0f1fec3ddb4bef0df24f050d0636
Reviewed-on: https://go-review.googlesource.com/c/tools/+/196258
Run-TryBot: Heschi Kreinick <heschi@google.com>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
@dmitshur

This comment has been minimized.

Copy link
Member

commented Sep 23, 2019

/cc @ianthehat FYI. This is the issue I mentioned to you in person just now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.