1 [short] skip
2 [!exec:hg] skip
3
4 env GO111MODULE=on
5 env GOPROXY=direct
6 env GOSUMDB=off
7 env GOMODCACHE=$WORK/modcache
8
9 # go mod download of a bunch of these should fail (some are invalid) but write good JSON for later
10 ! go mod download -json vcs-test.golang.org/hg/hello.hg@latest vcs-test.golang.org/hg/hello.hg/v9@latest vcs-test.golang.org/hg/hello.hg/sub/v9@latest vcs-test.golang.org/hg/tagtests.hg@latest vcs-test.golang.org/hg/tagtests.hg@v0.2.2 vcs-test.golang.org/hg/tagtests.hg@default
11 cp stdout all.json
12
13 # reuse go mod download vcstest/tagtests@default result again with all.json
14 go clean -modcache
15 go mod download -reuse=all.json -x -json vcs-test.golang.org/hg/tagtests.hg@default
16 ! stderr 'hg( .*)* pull'
17 stdout '"Reuse": true'
18 stdout '"Version": "v0.2.3-0.20190509225625-8d0b18b816df"'
19 stdout '"Query": "default"'
20 stdout '"VCS": "hg"'
21 stdout '"URL": ".*/hg/tagtests"'
22 ! stdout '"TagPrefix"'
23 stdout '"RepoSum": "r1:8dnv906Aq1vb9YpNl9pslfva0VfG9enKb6O6NWs0xF0="'
24 stdout '"Ref": "default"'
25 stdout '"Hash": "8d0b18b816df5e9c564761b405b1d7949c24ee6b"'
26 ! stdout '"(Dir|Info|GoMod|Zip)"'
27
28 # reuse the bulk results with all.json
29 go clean -modcache
30 ! go mod download -reuse=all.json -json vcs-test.golang.org/hg/hello.hg@latest vcs-test.golang.org/hg/hello.hg/v9@latest vcs-test.golang.org/hg/hello.hg/sub/v9@latest vcs-test.golang.org/hg/tagtests.hg@latest vcs-test.golang.org/hg/tagtests.hg@v0.2.2 vcs-test.golang.org/hg/tagtests.hg@default
31 ! stderr 'hg( .*)* pull'
32 stdout '"Reuse": true'
33 ! stdout '"(Dir|Info|GoMod|Zip)"'
View as plain text