func scriptConditions() map[string]script.Cond {
conds := scripttest.DefaultConds()
- // Our "exec" has a special case for plan9 git, which does not
- // behave like git on other platforms.
- //
- // TODO(bcmills): replace this special-case "exec" with a more tailored "git"
- // condition.
- conds["exec"] = script.CachedCondition(
- conds["exec"].Usage().Summary,
- func(name string) (bool, error) {
- if runtime.GOOS == "plan9" && name == "git" {
- // The Git command is usually not the real Git on Plan 9.
- // See https://golang.org/issues/29640.
- return false, nil
- }
- _, err := exec.LookPath(name)
- return err == nil, nil
- })
-
add := func(name string, cond script.Cond) {
if _, ok := conds[name]; ok {
panic(fmt.Sprintf("condition %q is already registered", name))
add("fuzz-instrumented", sysCondition("-fuzz with instrumentation", platform.FuzzInstrumented))
add("gc", script.BoolCondition(`runtime.Compiler == "gc"`, runtime.Compiler == "gc"))
add("gccgo", script.BoolCondition(`runtime.Compiler == "gccgo"`, runtime.Compiler == "gccgo"))
+ add("git", lazyBool("the 'git' executable exists and provides the standard CLI", hasWorkingGit))
add("GODEBUG", script.PrefixCondition("GODEBUG contains <suffix>", hasGodebug))
add("GOEXPERIMENT", script.PrefixCondition("GOEXPERIMENT <suffix> is enabled", hasGoexperiment))
add("link", lazyBool("testenv.HasLink()", testenv.HasLink))
}
return false, nil
}
+
+func hasWorkingGit() bool {
+ if runtime.GOOS == "plan9" {
+ // The Git command is usually not the real Git on Plan 9.
+ // See https://golang.org/issues/29640.
+ return false
+ }
+ _, err := exec.LookPath("git")
+ return err == nil
+}
runtime.Compiler == "gc"
[gccgo]
runtime.Compiler == "gccgo"
+[git]
+ the 'git' executable exists and provides the standard CLI
[hurd]
host GOOS=hurd
[illumos]
# not attempt to stamp VCS information when the VCS tool is not present.
[short] skip
-[!exec:git] skip
+[!git] skip
cd sub
exec git init .
# golang.org/issue/13037: 'go get' was not parsing <meta> tags in 404 served over HTTPS.
[!net] skip
-[!exec:git] skip
+[!git] skip
env GONOSUMDB=bazil.org,github.com,golang.org
env GO111MODULE=off
env GO111MODULE=off
-[!exec:git] skip
+[!git] skip
# Set up some empty repositories.
cd $WORK/_origin/foo
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=off
go get -u rsc.io/pdf/...
# Tests issue 8181
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=off
go get -v -t github.com/rsc/go-get-issue-8181/a github.com/rsc/go-get-issue-8181/b
# go get foo.io (not foo.io/subdir) was not working consistently.
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=off
# go-get-issue-9357.appspot.com is running
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=off
# Tests Issues #9797 and #19769
env GO111MODULE=off
[short] skip
-[!exec:git] skip
+[!git] skip
# Set up a benign repository and a repository with a dotfile name.
cd $WORK/_origin/foo
# TODO(matloob): Split this test into two? It's one of the slowest tests we have.
[!net] skip
-[!exec:git] skip
+[!git] skip
env PATH=$WORK/tmp/bin${:}$PATH
go build -o $WORK/tmp/bin/ssh ssh.go
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=off
! go get -d insecure.go-get-issue-15410.appspot.com/pkg/p
[!net] skip
-[!exec:git] skip
+[!git] skip
# GOPATH: Set up
env GO111MODULE=off
# golang.org/issue/34049: 'go get' would panic in case of an insecure redirect in GOPATH mode
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=off
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=off
# Clone the repo via HTTP manually.
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=off
# This used to fail with errors about internal packages
# go get -u was not working except in checkout directory
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=off
env GOPATH=$WORK/tmp/gopath
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=off
# This test verifies a fix for a security issue; see https://go.dev/issue/22125.
[!net] skip
-[!exec:git] skip
+[!git] skip
[!exec:svn] skip
env GO111MODULE=off
# The test still seems to be useful as a test of direct-mode go get.
[short] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=off
env GOPATH=$WORK/tmp/d1
[!net] skip
-[!exec:git] skip
+[!git] skip
env GOBIN=$WORK/tmp/gobin
env GO111MODULE=off
# Tests issue #20502
[!net] skip
-[!exec:git] skip
+[!git] skip
[!race] skip
env GO111MODULE=off
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=off
go get golang.org/x/tour/content...
# former dependencies, not current ones.
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=off
# Rewind
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=off
# Clone the repo via HTTPS manually.
# Issue 14450: go get -u .../ tried to import not downloaded package
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=off
go get github.com/tmwh/go-get-issue-14450/a
go get -t -d
[!net] stop
-[!exec:git] stop
+[!git] stop
cd $GOPATH/src
env GIT_TRACE=1
[!net] skip
-[!exec:git] skip
+[!git] skip
# go get should be success when GIT_TRACE set
go get golang.org/x/text
# Test that 'go get -u' reports moved git packages.
-[exec:git] go get -d rsc.io/pdf
-[exec:git] go get -d -u rsc.io/pdf
-[exec:git] exec ./replace.exe pdf rsc.io/pdf/.git/config
-
-[exec:git] ! go get -d -u rsc.io/pdf
-[exec:git] stderr 'is a custom import path for'
-[exec:git] ! go get -d -f -u rsc.io/pdf
-[exec:git] stderr 'validating server certificate|[nN]ot [fF]ound'
+[git] go get -d rsc.io/pdf
+[git] go get -d -u rsc.io/pdf
+[git] exec ./replace.exe pdf rsc.io/pdf/.git/config
+
+[git] ! go get -d -u rsc.io/pdf
+[git] stderr 'is a custom import path for'
+[git] ! go get -d -f -u rsc.io/pdf
+[git] stderr 'validating server certificate|[nN]ot [fF]ound'
# Test that 'go get -u' reports moved Mercurial packages.
# git is OK by default
env GOVCS=
env GONOSUMDB='*'
-[net] [exec:git] [!short] go get rsc.io/sampler
+[net] [git] [!short] go get rsc.io/sampler
# hg is OK by default
env GOVCS=
# git is OK by default
env GOVCS=
env GONOSUMDB='*'
-[net] [exec:git] [!short] go get rsc.io/sampler
+[net] [git] [!short] go get rsc.io/sampler
# hg is OK by default
env GOVCS=
stdout '"Deps": \['
stdout '"errors",'
-[!exec:git] skip
+[!git] skip
# Test -json=<field> without Stale skips computing buildinfo
cd repo
[short] skip
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=on
env GOPROXY=
env GOSUMDB=off
[!net] skip
-[!exec:git] skip
+[!git] skip
# secure fetch should report insecure warning
cd $WORK/test
env GO111MODULE=on
[!net] skip
-[!exec:git] skip
+[!git] skip
env GOPROXY=direct
env HOME=$WORK/home/gopher
# Testing mod download with non semantic versions; turn off proxy.
[!net] skip
-[!exec:git] skip
+[!git] skip
env GOPROXY=direct
env GOSUMDB=off
# golang.org/issue/29591: 'go get' was following plain-HTTP redirects even without -insecure (now replaced by GOINSECURE).
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=on
env GOPROXY=direct
[short] skip
-[!exec:git] skip
+[!git] skip
[!net] skip
[!linux] skip # Uses XDG_CONFIG_HOME
# Testing stderr for git ls-remote; turn off proxy.
[!net] skip
-[!exec:git] skip
+[!git] skip
env GOPROXY=direct
! go mod download github.com/golang/nonexist@latest
[short] skip
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=on
env GOPROXY=direct
env GOPROXY=direct
env GOSUMDB=off
[!net] skip
-[!exec:git] skip
+[!git] skip
# fetch commit hash reachable from refs/heads/* and refs/tags/* is OK
go list -m golang.org/x/time@8be79e1e0910c292df4e79c241bb7e8f7e725959 # on master branch
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=on
env GOPROXY=direct
# Testing git->module converter's generation of +incompatible tags; turn off proxy.
[!net] skip
-[!exec:git] skip
+[!git] skip
env GOPROXY=direct
env GOSUMDB=off
# supplied to 'go get', regardless of branches
[!net] skip
-[!exec:git] skip
+[!git] skip
# For this test repository:
# tag v0.2.1 is most recent tag on master itself
# to 'go get', when using a repo with go.mod in a sub directory.
[!net] skip
-[!exec:git] skip
+[!git] skip
# For this test repository go.mod resides in sub/ (only):
# master is not tagged
[short] skip
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=on
env GOPROXY=direct
# Testing that git export-subst is disabled
[!net] skip
-[!exec:git] skip
+[!git] skip
go build
-- x.go --
# GONOPROXY bypasses proxy
[!net] skip
-[!exec:git] skip
+[!git] skip
env GOPRIVATE=none
env GONOPROXY='*/fortune'
! go get rsc.io/fortune # does not exist in real world, only on test proxy
go list
[!net] skip
-[!exec:git] skip
+[!git] skip
skip # TODO(#54503): redirect gopkg.in requests to a local server and re-enable.
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=on
env GOPROXY=direct
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=on
env GOPROXY=direct
env GOSUMDB=off
[!net] skip
-[!exec:git] skip
+[!git] skip
# golang.org/issue/33099: if an import path ends in a major-version suffix,
# ensure that 'direct' mode can resolve the package to the module.
[short] skip
-[!exec:git] skip
+[!git] skip
[!net] skip
env GOPROXY=direct
# tags for prefixes of the module path.
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=on
env GOPROXY=direct
# order to determine whether it contains a go.mod file, and part of the point of
# the proxy is to avoid fetching unnecessary data.)
-[!exec:git] stop
+[!git] stop
env GOPROXY=direct
go list -versions -m github.com/russross/blackfriday github.com/russross/blackfriday
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=on
env GOPROXY=direct
[short] skip
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=on
env GOPROXY=direct
# Verifies golang.org/issue/41700.
[!net] skip
-[!exec:git] skip
+[!git] skip
env GOPROXY=direct
env GOSUMDB=off
go mod init m
# Download direct from github.
[!net] skip
-[!exec:git] skip
+[!git] skip
env GOSUMDB=sum.golang.org
env GOPROXY=direct
[short] skip
-[!exec:git] skip
+[!git] skip
[!net] skip
env GO111MODULE=on
# test binaries are almost never distributed to users.)
[short] skip
-[!exec:git] skip
+[!git] skip
exec git init
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=off
go get github.com/rsc/go-get-issue-11864
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=off
go get github.com/rsc/go-get-issue-11864
[!net] skip
-[!exec:git] skip
+[!git] skip
env GO111MODULE=off
cd $GOPATH
# controlled with -buildvcs. This test focuses on Git. Other tests focus on
# other VCS tools but may not cover common functionality.
-[!exec:git] skip
+[!git] skip
[short] skip
env GOBIN=$WORK/gopath/bin
env oldpath=$PATH
# the current commit is signed and the use has configured git to display commit
# signatures.
-[!exec:git] skip
+[!git] skip
[!exec:gpg] skip
[short] skip
env GOBIN=$GOPATH/bin
-[!exec:git] skip
+[!git] skip
[!exec:hg] skip
[short] skip
env GOFLAGS='-n -buildvcs'