Skip to content

Commit 6bb4fb8

Browse files
amchicletnoahdietz
authored andcommitted
test(profiler): use go 1.18.4 in integration test (#6348)
1 parent f3c3dee commit 6bb4fb8

1 file changed

Lines changed: 23 additions & 9 deletions

File tree

profiler/kokoro/integration_test.sh

100644100755
Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,28 @@ export GOOGLE_APPLICATION_CREDENTIALS="${KOKORO_KEYSTORE_DIR}/72935_cloud-profil
3434
export GCLOUD_TESTS_GOLANG_PROJECT_ID="cloud-profiler-e2e"
3535

3636
# Ensure a newer version of Go is used so it is compatible with newer libraries.
37-
# Here we install v1.17.7 which is the current version as of when this code
38-
# was written, following instructions from https://go.dev/doc/manage-install.
39-
# Go modules might not be on for previous versions of Go, so we also have to
40-
# enable the module system explicitly.
41-
export GO111MODULE=on
42-
go install golang.org/dl/go1.17.7
43-
go1.17.7 download
37+
# Here we install v1.18.4 which is the current version as of July 2022.
38+
mkdir -p /tmp/bin
39+
GIMME=/tmp/bin/gimme
40+
retry curl -sL -o "$GIMME" https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
41+
chmod +x "$GIMME"
42+
43+
export GIMME_GO_VERSION=1.18.4
44+
export GIMME_ENV_PREFIX=/tmp/gimme_envs
45+
install_go() {
46+
"$GIMME"
47+
# If gimme was successful, an .env script that sets up proper environment
48+
# variables will be created.
49+
if [[ -f "${GIMME_ENV_PREFIX}/go${GIMME_GO_VERSION}.env" ]]
50+
then
51+
source "${GIMME_ENV_PREFIX}/go${GIMME_GO_VERSION}.env"
52+
else
53+
return 1
54+
fi
55+
}
56+
retry install_go
4457

4558
# Run test.
46-
retry go1.17.7 mod download
47-
go1.17.7 test -run TestAgentIntegration -run_only_profiler_backoff_test -timeout 1h
59+
go version
60+
retry go mod download
61+
go test -run TestAgentIntegration -run_only_profiler_backoff_test -timeout 1h

0 commit comments

Comments
 (0)