[go] cmd/go: improve TestScript/reuse_git

4 views
Skip to first unread message

Russ Cox (Gerrit)

unread,
Nov 6, 2025, 5:18:30 AM (5 days ago) Nov 6
to Ian Alexander, Michael Matloob, goph...@pubsubhelper.golang.org, Michael Pratt, Russ Cox, golang-co...@googlegroups.com
Attention needed from Ian Alexander and Michael Matloob

Russ Cox has uploaded the change for review

Russ Cox would like Ian Alexander and Michael Matloob to review this change.

Commit message

cmd/go: improve TestScript/reuse_git

Most reuse origin info in git should not list RepoSum; check that.

Also add tests of go list -reuse, which were omitted entirely
in CL 411398.

For #75119.
Change-Id: Ia1436b8d9e17db49664d24f1d43c448ac7cd00d2

Change diff

diff --git a/src/cmd/go/testdata/script/reuse_git.txt b/src/cmd/go/testdata/script/reuse_git.txt
index 3c1b38b..5bcbea3 100644
--- a/src/cmd/go/testdata/script/reuse_git.txt
+++ b/src/cmd/go/testdata/script/reuse_git.txt
@@ -14,6 +14,7 @@
stdout '"VCS": "git"'
stdout '"URL": ".*/git/hello"'
stdout '"Hash": "fc3a09f3dc5cfe0d7a743ea18f1f5226e68b3777"'
+! stdout '"RepoSum"'
go clean -modcache

# go mod download vcstest/hello should invoke git, print origin info
@@ -28,6 +29,7 @@
stdout '"TagSum": "t1:47DEQpj8HBSa[+]/TImW[+]5JCeuQeRkm5NMpJWZG3hSuFU="'
stdout '"Ref": "HEAD"'
stdout '"Hash": "fc3a09f3dc5cfe0d7a743ea18f1f5226e68b3777"'
+! stdout '"RepoSum"'

# pseudo-version again should not invoke git fetch (it has the version from the @latest query)
# but still be careful not to include a TagSum or a Ref, especially not Ref set to HEAD,
@@ -47,6 +49,7 @@
stdout '"URL": ".*/git/hello"'
stdout '"TagSum": "t1:47DEQpj8HBSa[+]/TImW[+]5JCeuQeRkm5NMpJWZG3hSuFU="'
stdout '"Hash": "fc3a09f3dc5cfe0d7a743ea18f1f5226e68b3777"'
+! stdout '"RepoSum"'

# go mod download vcstest/hello/v9 should fail, still print origin info
! go mod download -x -json vcs-test.golang.org/git/hello.git/v9@latest
@@ -108,6 +111,7 @@
stdout '"TagSum": "t1:Dp7yRKDuE8WjG0429PN9hYWjqhy2te7P9Oki/sMEOGo="'
stdout '"Ref": "refs/tags/v0.2.2"'
stdout '"Hash": "59356c8cd18c5fe9a598167d98a6843e52d57952"'
+! stdout '"RepoSum"'

# go mod download vcstest/tagt...@v0.2.2 should print origin info, no TagSum needed
go mod download -x -json vcs-test.golang.org/git/tagtes...@v0.2.2
@@ -120,6 +124,7 @@
! stdout '"TagSum"'
stdout '"Ref": "refs/tags/v0.2.2"'
stdout '"Hash": "59356c8cd18c5fe9a598167d98a6843e52d57952"'
+! stdout '"RepoSum"'

# go mod download vcstest/tagtests@master needs a TagSum again
go mod download -x -json vcs-test.golang.org/git/tagtests.git@master
@@ -132,6 +137,7 @@
stdout '"TagSum": "t1:Dp7yRKDuE8WjG0429PN9hYWjqhy2te7P9Oki/sMEOGo="'
stdout '"Ref": "refs/heads/master"'
stdout '"Hash": "c7818c24fa2f3f714c67d0a6d3e411c85a518d1f"'
+! stdout '"RepoSum"'

# go mod download vcstest/prefixtagtests should invoke git, print origin info
go mod download -x -json vcs-test.golang.org/git/prefixtagtests.git/sub@latest
@@ -146,6 +152,7 @@
stdout '"TagSum": "t1:YGSbWkJ8dn9ORAr[+]BlKHFK/2ZhXLb9hVuYfTZ9D8C7g="'
stdout '"Ref": "refs/tags/sub/v0.0.10"'
stdout '"Hash": "2b7c4692e12c109263cab51b416fcc835ddd7eae"'
+! stdout '"RepoSum"'

# go mod download of a bunch of these should fail (some are invalid) but write good JSON for later
! go mod download -json vcs-test.golang.org/git/hello.git@latest vcs-test.golang.org/git/hello.git/v9@latest vcs-test.golang.org/git/hello.git/sub/v9@latest vcs-test.golang.org/git/tagtests.git@latest vcs-test.golang.org/git/tagtes...@v0.2.2 vcs-test.golang.org/git/tagtests.git@master
@@ -168,10 +175,7 @@
stdout '"TagSum": "t1:47DEQpj8HBSa[+]/TImW[+]5JCeuQeRkm5NMpJWZG3hSuFU="'
stdout '"Ref": "HEAD"'
stdout '"Hash": "fc3a09f3dc5cfe0d7a743ea18f1f5226e68b3777"'
-! stdout '"Dir"'
-! stdout '"Info"'
-! stdout '"GoMod"'
-! stdout '"Zip"'
+! stdout '"(Dir|Info|GoMod|Zip|RepoSum)"'

# reuse go mod download vcstest/hello pseudoversion result
go mod download -reuse=hellopseudo.json -x -json vcs-test.golang.org/git/hell...@v0.0.0-20170922010558-fc3a09f3dc5c
@@ -182,7 +186,7 @@
stdout '"URL": ".*/git/hello"'
! stdout '"(Query|TagPrefix|TagSum|Ref)"'
stdout '"Hash": "fc3a09f3dc5cfe0d7a743ea18f1f5226e68b3777"'
-! stdout '"(Dir|Info|GoMod|Zip)"'
+! stdout '"(Dir|Info|GoMod|Zip|RepoSum)"'

# reuse go mod download vcstest/hello@hash
go mod download -reuse=hellohash.json -x -json vcs-test.golang.org/git/hello.git@fc3a09f3dc5c
@@ -195,7 +199,7 @@
! stdout '"(TagPrefix|Ref)"'
stdout '"TagSum": "t1:47DEQpj8HBSa[+]/TImW[+]5JCeuQeRkm5NMpJWZG3hSuFU="'
stdout '"Hash": "fc3a09f3dc5cfe0d7a743ea18f1f5226e68b3777"'
-! stdout '"(Dir|Info|GoMod|Zip)"'
+! stdout '"(Dir|Info|GoMod|Zip|RepoSum)"'

# reuse go mod download vcstest/hello/v9 error result
! go mod download -reuse=hellov9.json -x -json vcs-test.golang.org/git/hello.git/v9@latest
@@ -206,7 +210,7 @@
stdout '"TagSum": "t1:47DEQpj8HBSa[+]/TImW[+]5JCeuQeRkm5NMpJWZG3hSuFU="'
stdout '"Ref": "HEAD"'
stdout '"Hash": "fc3a09f3dc5cfe0d7a743ea18f1f5226e68b3777"'
-! stdout '"(Dir|Info|GoMod|Zip)"'
+! stdout '"(Dir|Info|GoMod|Zip|RepoSum)"'

# reuse go mod download vcstest/hello/sub/v9 error result
! go mod download -reuse=hellosubv9.json -x -json vcs-test.golang.org/git/hello.git/sub/v9@latest
@@ -217,7 +221,7 @@
stdout '"TagSum": "t1:47DEQpj8HBSa[+]/TImW[+]5JCeuQeRkm5NMpJWZG3hSuFU="'
stdout '"Ref": "HEAD"'
stdout '"Hash": "fc3a09f3dc5cfe0d7a743ea18f1f5226e68b3777"'
-! stdout '"(Dir|Info|GoMod|Zip)"'
+! stdout '"(Dir|Info|GoMod|Zip|RepoSum)"'

# reuse go mod download vcstest/hello@nonexist
! go mod download -reuse=hellononexist.json -x -json vcs-test.golang.org/git/hello.git@nonexist
@@ -261,7 +265,7 @@
stdout '"TagSum": "t1:Dp7yRKDuE8WjG0429PN9hYWjqhy2te7P9Oki/sMEOGo="'
stdout '"Ref": "refs/tags/v0.2.2"'
stdout '"Hash": "59356c8cd18c5fe9a598167d98a6843e52d57952"'
-! stdout '"(Dir|Info|GoMod|Zip)"'
+! stdout '"(Dir|Info|GoMod|Zip|RepoSum)"'

# reuse go mod download vcstest/tagt...@v0.2.2 result
go mod download -reuse=tagtestsv022.json -x -json vcs-test.golang.org/git/tagtes...@v0.2.2
@@ -275,7 +279,7 @@
! stdout '"TagSum"'
stdout '"Ref": "refs/tags/v0.2.2"'
stdout '"Hash": "59356c8cd18c5fe9a598167d98a6843e52d57952"'
-! stdout '"(Dir|Info|GoMod|Zip)"'
+! stdout '"(Dir|Info|GoMod|Zip|RepoSum)"'

# reuse go mod download vcstest/tagtests@master result
go mod download -reuse=tagtestsmaster.json -x -json vcs-test.golang.org/git/tagtests.git@master
@@ -289,7 +293,7 @@
stdout '"TagSum": "t1:Dp7yRKDuE8WjG0429PN9hYWjqhy2te7P9Oki/sMEOGo="'
stdout '"Ref": "refs/heads/master"'
stdout '"Hash": "c7818c24fa2f3f714c67d0a6d3e411c85a518d1f"'
-! stdout '"(Dir|Info|GoMod|Zip)"'
+! stdout '"(Dir|Info|GoMod|Zip|RepoSum)"'

# reuse go mod download vcstest/tagtests@master result again with all.json
go mod download -reuse=all.json -x -json vcs-test.golang.org/git/tagtests.git@master
@@ -303,7 +307,7 @@
stdout '"TagSum": "t1:Dp7yRKDuE8WjG0429PN9hYWjqhy2te7P9Oki/sMEOGo="'
stdout '"Ref": "refs/heads/master"'
stdout '"Hash": "c7818c24fa2f3f714c67d0a6d3e411c85a518d1f"'
-! stdout '"(Dir|Info|GoMod|Zip)"'
+! stdout '"(Dir|Info|GoMod|Zip|RepoSum)"'

# go mod download vcstest/prefixtagtests result with json
go mod download -reuse=prefixtagtests.json -x -json vcs-test.golang.org/git/prefixtagtests.git/sub@latest
@@ -335,7 +339,7 @@
! stdout '"Query"'
stdout '"VCS": "git"'
stdout '"URL": ".*/git/tagtests"'
-! stdout '"(TagPrefix|TagSum)"'
+! stdout '"(TagPrefix|TagSum|RepoSum)"'
stdout '"Ref": "refs/tags/v0.2.2"'
stdout '"Hash": "59356c8cd18c5fe9a598167d98a6843e52d57952"'
stdout '"Dir"'
@@ -360,6 +364,7 @@
go mod download -reuse=tagtestsv022badvcs.json -x -json vcs-test.golang.org/git/tagtes...@v0.2.2
! stdout '"Reuse": true'
stdout '"URL": ".*/git/tagtests"'
+! stdout '"RepoSum"'

# reuse with stale Dir
cp tagtestsv022.json tagtestsv022baddir.json
@@ -367,6 +372,7 @@
go mod download -reuse=tagtestsv022baddir.json -x -json vcs-test.golang.org/git/tagtes...@v0.2.2
! stdout '"Reuse": true'
stdout '"URL": ".*/git/tagtests"'
+! stdout '"RepoSum"'

# reuse with stale TagSum
cp tagtests.json tagtestsbadtagsum.json
@@ -374,3 +380,82 @@
go mod download -reuse=tagtestsbadtagsum.json -x -json vcs-test.golang.org/git/tagtests.git@latest
! stdout '"Reuse": true'
stdout '"TagSum": "t1:Dp7yRKDuE8WjG0429PN9hYWjqhy2te7P9Oki/sMEOGo="'
+! stdout '"RepoSum"'
+
+# go list on repo with no tags
+go clean -modcache
+go list -x -json -m -retracted -json=Version,Versions,Error,Path,Query,Origin,Reuse -versions vcs-test.golang.org/git/hello.git@latest
+stderr 'git( .*)* fetch'
+cp stdout hellolist.json
+! stdout '"Versions"'
+stdout '"Version": "v0.0.0-20170922010558-fc3a09f3dc5c"'
+stdout '"VCS": "git"'
+stdout '"URL": ".*/git/hello"'
+stdout '"Query": "latest"'
+! stdout '"TagPrefix"'
+stdout '"TagSum": "t1:47DEQpj8HBSa[+]/TImW[+]5JCeuQeRkm5NMpJWZG3hSuFU="'
+stdout '"Hash": "fc3a09f3dc5cfe0d7a743ea18f1f5226e68b3777"'
+! stdout '"RepoSum"'
+
+# reuse go list on repo with no tags
+go clean -modcache
+go list -x -reuse=hellolist.json -json -m -retracted -versions vcs-test.golang.org/git/hello.git@latest
+! stderr 'git( .*)* fetch'
+stdout '"Reuse": true'
+! stdout '"Versions"'
+stdout '"Version": "v0.0.0-20170922010558-fc3a09f3dc5c"'
+stdout '"VCS": "git"'
+stdout '"URL": ".*/git/hello"'
+stdout '"Query": "latest"'
+! stdout '"TagPrefix"'
+stdout '"TagSum": "t1:47DEQpj8HBSa[+]/TImW[+]5JCeuQeRkm5NMpJWZG3hSuFU="'
+stdout '"Hash": "fc3a09f3dc5cfe0d7a743ea18f1f5226e68b3777"'
+! stdout '"RepoSum"'
+
+# reuse with stale list
+cp hellolist.json hellolistbad.json
+replace '47DEQ' 'ZZZ' hellolistbad.json
+go clean -modcache
+go list -x -reuse=hellolistbad.json -json -m -retracted -versions vcs-test.golang.org/git/hello.git@latest
+stderr 'git( .*)* fetch'
+! stdout '"Reuse": true'
+stdout '"TagSum": "t1:47DEQpj8HBSa[+]/TImW[+]5JCeuQeRkm5NMpJWZG3hSuFU="'
+
+# go list on repo with tags
+go clean -modcache
+go list -x -json -m -retracted -json=Version,Versions,Error,Path,Query,Origin,Reuse -versions vcs-test.golang.org/git/tagtests.git@latest
+cp stdout taglist.json
+stderr 'git( .*)* fetch'
+stdout '"Versions":'
+stdout '"v0.2.1"'
+stdout '"v0.2.2"'
+stdout '"Version": "v0.2.2"'
+stdout '"VCS": "git"'
+stdout '"URL": ".*/git/tagtests"'
+stdout '"Hash": "59356c8cd18c5fe9a598167d98a6843e52d57952"'
+stdout '"TagSum": "t1:Dp7yRKDuE8WjG0429PN9hYWjqhy2te7P9Oki/sMEOGo="'
+stdout '"Ref": "refs/tags/v0.2.2"'
+
+# reuse go list on repo with tags
+go clean -modcache
+go list -reuse=taglist.json -x -json -m -retracted -json=Version,Versions,Error,Path,Query,Origin,Reuse -versions vcs-test.golang.org/git/tagtests.git@latest
+! stderr 'git( .*)* fetch'
+stdout '"Reuse": true'
+stdout '"Versions":'
+stdout '"v0.2.1"'
+stdout '"v0.2.2"'
+stdout '"Version": "v0.2.2"'
+stdout '"VCS": "git"'
+stdout '"URL": ".*/git/tagtests"'
+stdout '"Hash": "59356c8cd18c5fe9a598167d98a6843e52d57952"'
+stdout '"TagSum": "t1:Dp7yRKDuE8WjG0429PN9hYWjqhy2te7P9Oki/sMEOGo="'
+stdout '"Ref": "refs/tags/v0.2.2"'
+
+# reuse with stale list
+cp taglist.json taglistbad.json
+replace 'Dp7yRKDu' 'ZZZ' taglistbad.json
+go clean -modcache
+go list -reuse=taglistbad.json -x -json -m -retracted -json=Version,Versions,Error,Path,Query,Origin,Reuse -versions vcs-test.golang.org/git/tagtests.git@latest
+stderr 'git( .*)* fetch'
+! stdout '"Reuse": true'
+stdout '"TagSum": "t1:Dp7yRKDuE8WjG0429PN9hYWjqhy2te7P9Oki/sMEOGo="'

Change information

Files:
  • M src/cmd/go/testdata/script/reuse_git.txt
Change size: M
Delta: 1 file changed, 98 insertions(+), 13 deletions(-)
Open in Gerrit

Related details

Attention is currently required from:
  • Ian Alexander
  • Michael Matloob
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ia1436b8d9e17db49664d24f1d43c448ac7cd00d2
Gerrit-Change-Number: 718380
Gerrit-PatchSet: 1
Gerrit-Owner: Russ Cox <r...@golang.org>
Gerrit-Reviewer: Ian Alexander <ji...@google.com>
Gerrit-Reviewer: Michael Matloob <mat...@google.com>
Gerrit-CC: Michael Pratt <mpr...@google.com>
Gerrit-Attention: Ian Alexander <ji...@google.com>
Gerrit-Attention: Michael Matloob <mat...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Russ Cox (Gerrit)

unread,
Nov 6, 2025, 5:18:34 AM (5 days ago) Nov 6
to Russ Cox, goph...@pubsubhelper.golang.org, Michael Matloob, Ian Alexander, Michael Pratt, golang-co...@googlegroups.com
Attention needed from Ian Alexander and Michael Matloob

Russ Cox voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Ian Alexander
  • Michael Matloob
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ia1436b8d9e17db49664d24f1d43c448ac7cd00d2
Gerrit-Change-Number: 718380
Gerrit-PatchSet: 1
Gerrit-Owner: Russ Cox <r...@golang.org>
Gerrit-Reviewer: Ian Alexander <ji...@google.com>
Gerrit-Reviewer: Michael Matloob <mat...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Michael Pratt <mpr...@google.com>
Gerrit-Attention: Ian Alexander <ji...@google.com>
Gerrit-Attention: Michael Matloob <mat...@google.com>
Gerrit-Comment-Date: Thu, 06 Nov 2025 10:18:29 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Russ Cox (Gerrit)

unread,
Nov 6, 2025, 12:00:25 PM (4 days ago) Nov 6
to Russ Cox, goph...@pubsubhelper.golang.org, Go LUCI, Michael Matloob, Ian Alexander, Michael Pratt, golang-co...@googlegroups.com
Attention needed from Ian Alexander and Michael Matloob

Russ Cox voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Ian Alexander
  • Michael Matloob
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ia1436b8d9e17db49664d24f1d43c448ac7cd00d2
Gerrit-Change-Number: 718380
Gerrit-PatchSet: 2
Gerrit-Owner: Russ Cox <r...@golang.org>
Gerrit-Reviewer: Ian Alexander <ji...@google.com>
Gerrit-Reviewer: Michael Matloob <mat...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Michael Pratt <mpr...@google.com>
Gerrit-Attention: Ian Alexander <ji...@google.com>
Gerrit-Attention: Michael Matloob <mat...@google.com>
Gerrit-Comment-Date: Thu, 06 Nov 2025 17:00:21 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Russ Cox (Gerrit)

unread,
Nov 6, 2025, 12:00:27 PM (4 days ago) Nov 6
to Russ Cox, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Ian Alexander and Michael Matloob

Russ Cox uploaded new patchset

Russ Cox uploaded patch set #2 to this change.
Following approvals got outdated and were removed:
  • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit

Related details

Attention is currently required from:
  • Ian Alexander
  • Michael Matloob
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
unsatisfied_requirement
satisfied_requirement
open
diffy

Michael Matloob (Gerrit)

unread,
Nov 7, 2025, 5:04:55 PM (3 days ago) Nov 7
to Russ Cox, goph...@pubsubhelper.golang.org, Go LUCI, Michael Matloob, Ian Alexander, Michael Pratt, golang-co...@googlegroups.com
Attention needed from Ian Alexander, Michael Matloob and Russ Cox

Michael Matloob voted and added 1 comment

Votes added by Michael Matloob

Code-Review+2

1 comment

File src/cmd/go/testdata/script/reuse_git.txt
Line 18, Patchset 2 (Latest):go clean -modcache
Michael Matloob . unresolved

I might be confused here, but this isn't affecting the GOMODCACHE of the user running the test, right? I know that in some tests we clear the GOMODCACHE, and here we're not doing that, and I couldn't find a place in the script test code where we're resetting the GOMODCACHE variable for the test, but maybe I'm not looking in the right place.

Open in Gerrit

Related details

Attention is currently required from:
  • Ian Alexander
  • Michael Matloob
  • Russ Cox
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ia1436b8d9e17db49664d24f1d43c448ac7cd00d2
Gerrit-Change-Number: 718380
Gerrit-PatchSet: 2
Gerrit-Owner: Russ Cox <r...@golang.org>
Gerrit-Reviewer: Ian Alexander <ji...@google.com>
Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
Gerrit-Reviewer: Michael Matloob <mat...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Michael Pratt <mpr...@google.com>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Attention: Ian Alexander <ji...@google.com>
Gerrit-Attention: Michael Matloob <mat...@google.com>
Gerrit-Comment-Date: Fri, 07 Nov 2025 22:04:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Michael Matloob (Gerrit)

unread,
Nov 7, 2025, 5:09:25 PM (3 days ago) Nov 7
to Russ Cox, goph...@pubsubhelper.golang.org, Michael Matloob, Go LUCI, Ian Alexander, Michael Pratt, golang-co...@googlegroups.com
Attention needed from Ian Alexander and Russ Cox

Michael Matloob voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Ian Alexander
  • Russ Cox
Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ia1436b8d9e17db49664d24f1d43c448ac7cd00d2
    Gerrit-Change-Number: 718380
    Gerrit-PatchSet: 2
    Gerrit-Owner: Russ Cox <r...@golang.org>
    Gerrit-Reviewer: Ian Alexander <ji...@google.com>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-Reviewer: Michael Matloob <mat...@google.com>
    Gerrit-Reviewer: Russ Cox <r...@golang.org>
    Gerrit-CC: Michael Pratt <mpr...@google.com>
    Gerrit-Attention: Russ Cox <r...@golang.org>
    Gerrit-Attention: Ian Alexander <ji...@google.com>
    Gerrit-Comment-Date: Fri, 07 Nov 2025 22:09:22 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Russ Cox (Gerrit)

    unread,
    Nov 7, 2025, 5:15:07 PM (3 days ago) Nov 7
    to Russ Cox, goph...@pubsubhelper.golang.org, Michael Matloob, Michael Matloob, Go LUCI, Ian Alexander, Michael Pratt, golang-co...@googlegroups.com
    Attention needed from Ian Alexander

    Russ Cox added 1 comment

    File src/cmd/go/testdata/script/reuse_git.txt
    Michael Matloob . resolved

    I might be confused here, but this isn't affecting the GOMODCACHE of the user running the test, right? I know that in some tests we clear the GOMODCACHE, and here we're not doing that, and I couldn't find a place in the script test code where we're resetting the GOMODCACHE variable for the test, but maybe I'm not looking in the right place.

    Russ Cox

    Took me a while to find this, but it's okay. Instead of clearing variables, we set an explicit complete environment in script_test.go's scriptEnv. It does not inherit any variables from os.Environ except by explicit copying of specific variables. We don't set GOMODCACHE, so it defaults to GOPATH/pkg/mod, and GOPATH is temporary for the test. Otherwise parallel tests would be failing too with some tests clearing module caches out from under others.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Ian Alexander
    Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ia1436b8d9e17db49664d24f1d43c448ac7cd00d2
    Gerrit-Change-Number: 718380
    Gerrit-PatchSet: 2
    Gerrit-Owner: Russ Cox <r...@golang.org>
    Gerrit-Reviewer: Ian Alexander <ji...@google.com>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-Reviewer: Michael Matloob <mat...@google.com>
    Gerrit-Reviewer: Russ Cox <r...@golang.org>
    Gerrit-CC: Michael Pratt <mpr...@google.com>
    Gerrit-Attention: Ian Alexander <ji...@google.com>
    Gerrit-Comment-Date: Fri, 07 Nov 2025 22:15:03 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Michael Matloob <mat...@golang.org>
    satisfied_requirement
    open
    diffy

    Russ Cox (Gerrit)

    unread,
    Nov 7, 2025, 5:16:22 PM (3 days ago) Nov 7
    to Russ Cox, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Michael Matloob, Michael Matloob, Go LUCI, Ian Alexander, Michael Pratt, golang-co...@googlegroups.com

    Russ Cox submitted the change

    Change information

    Commit message:
    cmd/go: improve TestScript/reuse_git

    Most reuse origin info in git should not list RepoSum; check that.

    Also add tests of go list -reuse, which were omitted entirely
    in CL 411398.

    Also be extra sure there is no repo left in module cache during reuse tests.

    For #75119.
    Change-Id: Ia1436b8d9e17db49664d24f1d43c448ac7cd00d2
    Reviewed-by: Michael Matloob <mat...@google.com>
    Reviewed-by: Michael Matloob <mat...@golang.org>
    Files:
    • M src/cmd/go/testdata/script/reuse_git.txt
    Change size: M
    Delta: 1 file changed, 118 insertions(+), 13 deletions(-)
    Branch: refs/heads/master
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Michael Matloob, +2 by Michael Matloob
    • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ia1436b8d9e17db49664d24f1d43c448ac7cd00d2
    Gerrit-Change-Number: 718380
    Gerrit-PatchSet: 3
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages