From ce3f0b85293f34ac4948ed34dc9b1388fdbe58b1 Mon Sep 17 00:00:00 2001 From: Amarin Phaosawasdi Date: Fri, 15 Jul 2022 15:27:39 -0700 Subject: [PATCH 1/3] test(profiler): log go version in integration test --- profiler/kokoro/integration_test.sh | 1 + 1 file changed, 1 insertion(+) mode change 100644 => 100755 profiler/kokoro/integration_test.sh diff --git a/profiler/kokoro/integration_test.sh b/profiler/kokoro/integration_test.sh old mode 100644 new mode 100755 index ca32f6e8fa8..26abedad898 --- a/profiler/kokoro/integration_test.sh +++ b/profiler/kokoro/integration_test.sh @@ -39,6 +39,7 @@ export GCLOUD_TESTS_GOLANG_PROJECT_ID="cloud-profiler-e2e" # Go modules might not be on for previous versions of Go, so we also have to # enable the module system explicitly. export GO111MODULE=on +go version go install golang.org/dl/go1.17.7 go1.17.7 download From abe256f031f4b4dacb13a75a587e1fc16248e978 Mon Sep 17 00:00:00 2001 From: Amarin Phaosawasdi Date: Fri, 15 Jul 2022 18:39:07 -0700 Subject: [PATCH 2/3] test(profiler): use go 1.18.4 for integration testing --- profiler/kokoro/integration_test.sh | 34 ++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/profiler/kokoro/integration_test.sh b/profiler/kokoro/integration_test.sh index 26abedad898..f48d89da00d 100755 --- a/profiler/kokoro/integration_test.sh +++ b/profiler/kokoro/integration_test.sh @@ -34,15 +34,29 @@ export GOOGLE_APPLICATION_CREDENTIALS="${KOKORO_KEYSTORE_DIR}/72935_cloud-profil export GCLOUD_TESTS_GOLANG_PROJECT_ID="cloud-profiler-e2e" # Ensure a newer version of Go is used so it is compatible with newer libraries. -# Here we install v1.17.7 which is the current version as of when this code -# was written, following instructions from https://go.dev/doc/manage-install. -# Go modules might not be on for previous versions of Go, so we also have to -# enable the module system explicitly. -export GO111MODULE=on -go version -go install golang.org/dl/go1.17.7 -go1.17.7 download +# Here we install v1.18.4 which is the current version as of when this code +# was written. +mkdir -p /tmp/bin +GIMME=/tmp/bin/gimme +retry curl -sL -o "$GIMME" https://raw.githubusercontent.com/travis-ci/gimme/master/gimme +chmod +x "$GIMME" + +export GIMME_GO_VERSION=1.18.4 +export GIMME_ENV_PREFIX=/tmp/gimme_envs +install_go() { + "$GIMME" + # If gimme was successful, an .env script that sets up proper environment + # variables will be created. + if [[ -f "${GIMME_ENV_PREFIX}/go${GIMME_GO_VERSION}.env" ]] + then + source "${GIMME_ENV_PREFIX}/go${GIMME_GO_VERSION}.env" + else + return 1 + fi +} +retry install_go # Run test. -retry go1.17.7 mod download -go1.17.7 test -run TestAgentIntegration -run_only_profiler_backoff_test -timeout 1h +go version +retry go mod download +go test -run TestAgentIntegration -run_only_profiler_backoff_test -timeout 1h From 642da6d6eb6ed50a52d7e45835dd78c314f8ce1a Mon Sep 17 00:00:00 2001 From: Amarin Phaosawasdi Date: Mon, 18 Jul 2022 11:13:07 -0700 Subject: [PATCH 3/3] test(profiler): update comments in integration test --- profiler/kokoro/integration_test.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/profiler/kokoro/integration_test.sh b/profiler/kokoro/integration_test.sh index f48d89da00d..8a655dc2331 100755 --- a/profiler/kokoro/integration_test.sh +++ b/profiler/kokoro/integration_test.sh @@ -34,8 +34,7 @@ export GOOGLE_APPLICATION_CREDENTIALS="${KOKORO_KEYSTORE_DIR}/72935_cloud-profil export GCLOUD_TESTS_GOLANG_PROJECT_ID="cloud-profiler-e2e" # Ensure a newer version of Go is used so it is compatible with newer libraries. -# Here we install v1.18.4 which is the current version as of when this code -# was written. +# Here we install v1.18.4 which is the current version as of July 2022. mkdir -p /tmp/bin GIMME=/tmp/bin/gimme retry curl -sL -o "$GIMME" https://raw.githubusercontent.com/travis-ci/gimme/master/gimme