From 2aa8971910a24e35c47c304e5b8d241c134ddd5a Mon Sep 17 00:00:00 2001 From: Jay Conrod Date: Thu, 9 May 2019 16:22:38 -0400 Subject: [PATCH] cmd/go: move two vcs test repos to vcs-test.golang.org Follow-up to CL 174061. This also fixes a break after GOSUMDB was introduced. Updates #31946 Updates #31673 Updates #31287 Updates #27171 Change-Id: I8e91e857f301b6b73cc90f2f2c68523412e22b46 Reviewed-on: https://go-review.googlesource.com/c/go/+/176417 Run-TryBot: Jay Conrod TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- .../script/mod_get_pseudo_other_branch.txt | 50 ++++++++++++++++--- .../testdata/script/mod_get_pseudo_prefix.txt | 47 +++++++++++++---- 2 files changed, 81 insertions(+), 16 deletions(-) diff --git a/src/cmd/go/testdata/script/mod_get_pseudo_other_branch.txt b/src/cmd/go/testdata/script/mod_get_pseudo_other_branch.txt index fa1398e545..fcff9b1ea3 100644 --- a/src/cmd/go/testdata/script/mod_get_pseudo_other_branch.txt +++ b/src/cmd/go/testdata/script/mod_get_pseudo_other_branch.txt @@ -1,7 +1,6 @@ env GO111MODULE=on -env GOPROXY= - -# TODO(jayconrod): get test repo onto vcs-test.golang.org +env GOPROXY=direct +env GOSUMDB=off # Testing that a pseudo-version is based on the semantically-latest # tag that appears in any commit that is a (transitive) parent of the commit @@ -13,13 +12,14 @@ env GOPROXY= # For this test repository: # tag v0.2.1 is most recent tag on master itself # tag v0.2.2 is on branch2, which was then merged to master -# commit 5aaa858 is on master at a later point +# master is a merge commit with both tags as parents # # The pseudo-version hence sorts immediately after v0.2.2 rather # than v0.2.1, even though the v0.2.2 tag is not on master. -go get -m github.com/leitzler/tagtests@5aaa858 + +go get -m vcs-test.golang.org/git/tagtests.git@master go list -m all -stdout '^github.com/leitzler/tagtests v0.2.3-0.20190424071028-5aaa858a59e2$' +stdout '^vcs-test.golang.org/git/tagtests.git v0.2.3-0\.' -- go.mod -- module x @@ -28,4 +28,40 @@ go 1.12 -- x.go -- package x -import _ "github.com/leitzler/tagtests" +import _ "vcs-test.golang.org/git/tagtests.git" +-- gen_testtags.sh -- +#!/bin/bash + +# This is not part of the test. +# Run this to generate and update the repository on vcs-test.golang.org. + +set -euo pipefail +cd "$(dirname "$0")" +rm -rf tagtests +mkdir tagtests +cd tagtests + +git init +echo module vcs-test.golang.org/git/tagtests.git >go.mod +echo package tagtests >tagtests.go +git add go.mod tagtests.go +git commit -m 'create module tagtests' + +git branch b + +echo v0.2.1 >v0.2.1 +git add v0.2.1 +git commit -m v0.2.1 +git tag v0.2.1 + +git checkout b +echo v0.2.2 >v0.2.2 +git add v0.2.2 +git commit -m v0.2.2 +git tag v0.2.2 + +git checkout master +git merge b -m merge + +zip -r ../tagtests.zip . +gsutil cp ../tagtests.zip gs://vcs-test/git/tagtests.zip diff --git a/src/cmd/go/testdata/script/mod_get_pseudo_prefix.txt b/src/cmd/go/testdata/script/mod_get_pseudo_prefix.txt index f46444e836..4d1a8b8632 100644 --- a/src/cmd/go/testdata/script/mod_get_pseudo_prefix.txt +++ b/src/cmd/go/testdata/script/mod_get_pseudo_prefix.txt @@ -1,7 +1,6 @@ env GO111MODULE=on -env GOPROXY= - -# TODO(jayconrod): get test repo onto vcs-test.golang.org +env GOPROXY=direct +env GOSUMDB=off # Testing that a pseudo-version is based on the semantically-latest # prefixed tag in any commit that is a parent of the commit supplied @@ -11,19 +10,19 @@ env GOPROXY= [!exec:git] skip # For this test repository go.mod resides in sub/ (only): -# master (372cb6e) is not tagged +# master is not tagged # tag v0.2.0 is most recent tag before master # tag sub/v0.0.10 is most recent tag before v0.2.0 # # The pseudo-version is based on sub/v0.0.10, since v0.2.0 doesn't # contain the prefix. -go get -m github.com/leitzler/prefixtagtests/sub +go get -m vcs-test.golang.org/git/prefixtagtests.git/sub go list -m all -stdout '^github.com/leitzler/prefixtagtests/sub v0.0.10$' +stdout '^vcs-test.golang.org/git/prefixtagtests.git/sub v0.0.10$' -go get -u -m github.com/leitzler/prefixtagtests/sub@372cb6e +go get -u -m vcs-test.golang.org/git/prefixtagtests.git/sub@master go list -m all -stdout '^github.com/leitzler/prefixtagtests/sub v0.0.11-0.20190427183112-372cb6ea3fb5$' +stdout '^vcs-test.golang.org/git/prefixtagtests.git/sub v0.0.11-0\.' -- go.mod -- module x @@ -32,4 +31,34 @@ go 1.12 -- x.go -- package x -import _ "github.com/leitzler/prefixtagtests/sub" +import _ "vcs-test.golang.org/prefixtagtests.git/sub" +-- gen_prefixtagtests.sh -- +#!/bin/bash + +# This is not part of the test. +# Run this to generate and update the repository on vcs-test.golang.org. + +set -euo pipefail +cd "$(dirname "$0")" +rm -rf prefixtagtests +mkdir prefixtagtests +cd prefixtagtests + +git init +mkdir sub +echo module vcs-test.golang.org/git/prefixtagtests.git/sub >sub/go.mod +echo package sub >sub/sub.go +git add sub +git commit -m 'create module sub' +for i in v0.1.0 sub/v0.0.9 sub/v0.0.10 v0.2.0; do + echo $i >status + git add status + git commit -m $i + git tag $i +done +echo 'after last tag' >status +git add status +git commit -m 'after last tag' + +zip -r ../prefixtagtests.zip . +gsutil cp ../prefixtagtests.zip gs://vcs-test/git/prefixtagtests.zip -- 2.48.1