From e232b3df7711d1850278fbc573fc1cd7ce1640f6 Mon Sep 17 00:00:00 2001 From: risk danger olson Date: Tue, 23 Feb 2016 13:46:51 -0700 Subject: [PATCH 1/2] update test so it passes regardless of git version or batch api changed in a4771400b29ef8356bc60c47f8f2dab26b217903 --- test/test-credentials-no-prompt.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/test-credentials-no-prompt.sh b/test/test-credentials-no-prompt.sh index 038cf975..61b90a5e 100755 --- a/test/test-credentials-no-prompt.sh +++ b/test/test-credentials-no-prompt.sh @@ -5,6 +5,14 @@ # these tests rely on GIT_TERMINAL_PROMPT to test properly ensure_git_version_isnt $VERSION_LOWER "2.3.0" +# if there is a system cred helper we can't run this test +# can't disable without changing state outside test & probably don't have permission +# this is common on OS X with certain versions of Git installed, default cred helper +if [[ "$(git config --system credential.helper)" -ne "" ]]; then + echo "skip: $0 (system cred helper we can't disable)" + exit +fi + begin_test "attempt private access without credential helper" ( set -e @@ -23,7 +31,7 @@ begin_test "attempt private access without credential helper" git config --global --unset credential.helper GIT_TERMINAL_PROMPT=0 git push origin master 2>&1 | tee push.log - - grep "Authorization error: $GITSERVER/$reponame" push.log + grep "Authorization error: $GITSERVER/$reponame" push.log || + grep "Git credentials for $GITSERVER/$reponame not found" push.log ) end_test From 17db7ed135c29921a463aabdda53e80236b06d4f Mon Sep 17 00:00:00 2001 From: risk danger olson Date: Tue, 23 Feb 2016 10:20:41 -0700 Subject: [PATCH 2/2] Backport go-1.6 from #1025 to release-1.1 --- .travis.yml | 18 +++++++++++++++++- script/bootstrap | 2 +- script/build.go | 3 ++- script/integration | 2 +- script/release | 2 +- script/run | 2 +- script/test | 2 +- test/testhelpers.sh | 4 ++-- 8 files changed, 26 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index cb75f794..f5db6a69 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ # http://docs.travis-ci.com/user/languages/go/ language: go -go: 1.5 +go: 1.6 os: - linux @@ -30,6 +30,22 @@ matrix: - > brew update; brew install git; + - env: git-latest-go-1.5 + os: linux + go: 1.5 + addons: + apt: + sources: + - git-core + packages: + - git + - env: git-latest-go-1.5 + os: osx + go: 1.5 + before_script: + - > + brew update; + brew install git; before_install: - > diff --git a/script/bootstrap b/script/bootstrap index 1807722a..3cf96be8 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -12,4 +12,4 @@ fi script/fmt rm -rf bin/* -go run script/*.go -cmd build "$@" +GO15VENDOREXPERIMENT=0 go run script/*.go -cmd build "$@" diff --git a/script/build.go b/script/build.go index 5c609a8f..cd75a249 100644 --- a/script/build.go +++ b/script/build.go @@ -154,12 +154,13 @@ func buildCommand(dir, buildos, buildarch string) error { } func buildGoEnv(buildos, buildarch string) []string { - env := make([]string, 5, 8) + env := make([]string, 6, 9) env[0] = "GOOS=" + buildos env[1] = "GOARCH=" + buildarch env[2] = "GOPATH=" + os.Getenv("GOPATH") env[3] = "GOROOT=" + os.Getenv("GOROOT") env[4] = "PATH=" + os.Getenv("PATH") + env[5] = "GO15VENDOREXPERIMENT=" + os.Getenv("GO15VENDOREXPERIMENT") for _, key := range []string{"TMP", "TEMP", "TEMPDIR"} { v := os.Getenv(key) if len(v) == 0 { diff --git a/script/integration b/script/integration index 7d40eee5..884dbd15 100755 --- a/script/integration +++ b/script/integration @@ -46,4 +46,4 @@ parallel=${GIT_LFS_TEST_MAXPROCS:-4} echo "Running this maxprocs=$parallel" echo -GIT_LFS_TEST_MAXPROCS=$parallel GIT_LFS_TEST_DIR="$GIT_LFS_TEST_DIR" SHUTDOWN_LFS="no" go run script/*.go -cmd integration "$@" +GO15VENDOREXPERIMENT=0 GIT_LFS_TEST_MAXPROCS=$parallel GIT_LFS_TEST_DIR="$GIT_LFS_TEST_DIR" SHUTDOWN_LFS="no" go run script/*.go -cmd integration "$@" diff --git a/script/release b/script/release index 29f350c6..5a7e6cd7 100755 --- a/script/release +++ b/script/release @@ -1,3 +1,3 @@ #!/usr/bin/env bash script/fmt -go run script/*.go -cmd release "$@" +GO15VENDOREXPERIMENT=0 go run script/*.go -cmd release "$@" diff --git a/script/run b/script/run index 5c8b0a08..6db3d56b 100755 --- a/script/run +++ b/script/run @@ -1,4 +1,4 @@ #!/usr/bin/env bash script/fmt commit=`git rev-parse --short HEAD` -go run -ldflags="-X github.com/github/git-lfs/lfs.GitCommit $commit" ./git-lfs.go "$@" +GO15VENDOREXPERIMENT=0 go run -ldflags="-X github.com/github/git-lfs/lfs.GitCommit $commit" ./git-lfs.go "$@" diff --git a/script/test b/script/test index e6e2443c..7f9fe3b0 100755 --- a/script/test +++ b/script/test @@ -7,4 +7,4 @@ suite="./${1:-"lfs"} ./${1:-"git"}" if [ $# -gt 0 ]; then shift fi -go test $suite "$@" +GO15VENDOREXPERIMENT=0 go test $suite "$@" diff --git a/test/testhelpers.sh b/test/testhelpers.sh index fc736497..c4304f98 100644 --- a/test/testhelpers.sh +++ b/test/testhelpers.sh @@ -215,10 +215,10 @@ setup() { if [ -z "$SKIPCOMPILE" ]; then for go in test/cmd/*.go; do - go build -o "$BINPATH/$(basename $go .go)" "$go" + GO15VENDOREXPERIMENT=0 go build -o "$BINPATH/$(basename $go .go)" "$go" done # Ensure API test util is built during tests to ensure it stays in sync - go build -o "$BINPATH/git-lfs-test-server-api" "test/git-lfs-test-server-api/main.go" "test/git-lfs-test-server-api/testdownload.go" "test/git-lfs-test-server-api/testupload.go" + GO15VENDOREXPERIMENT=0 go build -o "$BINPATH/git-lfs-test-server-api" "test/git-lfs-test-server-api/main.go" "test/git-lfs-test-server-api/testdownload.go" "test/git-lfs-test-server-api/testupload.go" fi LFSTEST_URL="$LFS_URL_FILE" LFSTEST_DIR="$REMOTEDIR" lfstest-gitserver > "$REMOTEDIR/gitserver.log" 2>&1 &