Skip to content
This repository was archived by the owner on Feb 20, 2026. It is now read-only.

Commit 07f69a7

Browse files
authored
fix: update go installation method (#862)
1 parent 3dd65e9 commit 07f69a7

2 files changed

Lines changed: 16 additions & 12 deletions

File tree

system-test/integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var (
4040
pr = flag.Int("pr", 0, "git pull request to test")
4141
runBackoffTest = flag.Bool("run_backoff_test", false, "Enables the backoff integration test. This integration test requires over 45 mins to run, so it is not run by default.")
4242

43-
runID = strings.Replace(time.Now().Format("2006-01-02-15-04-05.000000-0700"), ".", "-", -1)
43+
runID = strings.ToLower(strings.Replace(time.Now().Format("2006-01-02-15-04-05.000000-MST"), ".", "-", -1))
4444
benchFinishString = "benchmark application(s) complete"
4545
errorString = "failed to set up or run the benchmark"
4646
)

system-test/integration_test.sh

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ set -x
1616

1717
cd $(dirname $0)/..
1818

19+
git config --global --add safe.directory /tmpfs/src/github/cloud-profiler-nodejs
20+
1921
SERVICE_KEY="${KOKORO_KEYSTORE_DIR}/72935_cloud-profiler-e2e-service-account-key"
2022
COMMIT=$(git rev-parse HEAD)
2123
BRANCH=$(git rev-parse --abbrev-ref HEAD)
@@ -27,22 +29,24 @@ export GOOGLE_APPLICATION_CREDENTIALS="${SERVICE_KEY}"
2729
# Run test.
2830
cd "system-test"
2931

32+
go version
33+
3034
# Ensure a newer version of Go is used so it is compatible with newer libraries.
31-
# Here we install v1.17.7 which is the current version as of when this code
32-
# was written, following instructions from https://go.dev/doc/manage-install.
33-
# Go modules might not be on for previous versions of Go, so we also have to
34-
# enable the module system explicitly.
35-
export GO111MODULE=on
36-
go install golang.org/dl/go1.17.7
37-
go1.17.7 download
35+
# The current Go version in the VM is 1.18.4, however we explicitly set it to
36+
# pin the Go dependency to v1.18.4 for consistency.
37+
retry sudo apt-get install -y wget
38+
39+
wget https://go.dev/dl/go1.18.4.linux-amd64.tar.gz
40+
sudo rm -rf /usr/local/go && tar -C /usr/local -xzf go1.18.4.linux-amd64.tar.gz
41+
export PATH=$PATH:/usr/local/go/bin
3842

3943
# Initializing go modules allows our dependencies to install versions of their
4044
# dependencies specified by their go.mod files. This reduces the likelihood of
4145
# dependencies breaking this test.
42-
go1.17.7 version
43-
go1.17.7 mod init e2e
44-
retry go1.17.7 get cloud.google.com/go/profiler/proftest@HEAD
45-
retry go1.17.7 test -c -tags=integration .
46+
go version
47+
go mod init e2e
48+
retry go get cloud.google.com/go/profiler/proftest@HEAD
49+
retry go test -c -tags=integration .
4650

4751
if [ "$KOKORO_GITHUB_PULL_REQUEST_NUMBER" = "" ]; then
4852
./e2e.test -commit="$COMMIT" -branch="$BRANCH" -repo="$REPO" -run_backoff_test=true

0 commit comments

Comments
 (0)