Skip to content

Commit c5046bc

Browse files
committed
cmd/go/internal/modconv: fix TestConvertLegacyConfig expectations
It was a bug to find that commit in the Masterminds/semver repo. It's not part of the main repo but only part of an unmerged pull request. The code was updated to try not to look at unmerged pull requests, but the test was not. Worse, whether the code succeeds at not looking at unmerged pull requests apparently depends on the git version. Sigh. Fixes #26754. Fixes #27043. Change-Id: Ib9e07f565906de4f1169244911a258396688f14d Reviewed-on: https://go-review.googlesource.com/129800 Run-TryBot: Russ Cox <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 5d750db commit c5046bc

File tree

1 file changed

+30
-22
lines changed

1 file changed

+30
-22
lines changed

src/cmd/go/internal/modconv/convert_test.go

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -61,28 +61,36 @@ func TestConvertLegacyConfig(t *testing.T) {
6161
vers string
6262
gomod string
6363
}{
64-
{
65-
// Gopkg.lock parsing.
66-
"github.com/golang/dep", "v0.4.0",
67-
`module github.com/golang/dep
68-
69-
require (
70-
github.com/Masterminds/semver v0.0.0-20170726230514-a93e51b5a57e
71-
github.com/Masterminds/vcs v1.11.1
72-
github.com/armon/go-radix v0.0.0-20160115234725-4239b77079c7
73-
github.com/boltdb/bolt v1.3.1
74-
github.com/go-yaml/yaml v0.0.0-20170407172122-cd8b52f8269e
75-
github.com/golang/protobuf v0.0.0-20170901042739-5afd06f9d81a
76-
github.com/jmank88/nuts v0.3.0
77-
github.com/nightlyone/lockfile v0.0.0-20170707060451-e83dc5e7bba0
78-
github.com/pelletier/go-toml v0.0.0-20171218135716-b8b5e7696574
79-
github.com/pkg/errors v0.8.0
80-
github.com/sdboyer/constext v0.0.0-20170321163424-836a14457353
81-
golang.org/x/net v0.0.0-20170828231752-66aacef3dd8a
82-
golang.org/x/sync v0.0.0-20170517211232-f52d1811a629
83-
golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea
84-
)`,
85-
},
64+
/*
65+
Different versions of git seem to find or not find
66+
github.com/Masterminds/semver's a93e51b5a57e,
67+
which is an unmerged pull request.
68+
We'd rather not provide access to unmerged pull requests,
69+
so the line is removed from the golden file here,
70+
but some git commands still find it somehow.
71+
72+
{
73+
// Gopkg.lock parsing.
74+
"github.com/golang/dep", "v0.4.0",
75+
`module github.com/golang/dep
76+
77+
require (
78+
github.com/Masterminds/vcs v1.11.1
79+
github.com/armon/go-radix v0.0.0-20160115234725-4239b77079c7
80+
github.com/boltdb/bolt v1.3.1
81+
github.com/go-yaml/yaml v0.0.0-20170407172122-cd8b52f8269e
82+
github.com/golang/protobuf v0.0.0-20170901042739-5afd06f9d81a
83+
github.com/jmank88/nuts v0.3.0
84+
github.com/nightlyone/lockfile v0.0.0-20170707060451-e83dc5e7bba0
85+
github.com/pelletier/go-toml v0.0.0-20171218135716-b8b5e7696574
86+
github.com/pkg/errors v0.8.0
87+
github.com/sdboyer/constext v0.0.0-20170321163424-836a14457353
88+
golang.org/x/net v0.0.0-20170828231752-66aacef3dd8a
89+
golang.org/x/sync v0.0.0-20170517211232-f52d1811a629
90+
golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea
91+
)`,
92+
},
93+
*/
8694

8795
// TODO: https://github.com/docker/distribution uses vendor.conf
8896

0 commit comments

Comments
 (0)