diff --git a/integration-tests/idtoken/idtoken_test.go b/idtoken/integration_test.go similarity index 90% rename from integration-tests/idtoken/idtoken_test.go rename to idtoken/integration_test.go index cf32a3f8677..32281fa8507 100644 --- a/integration-tests/idtoken/idtoken_test.go +++ b/idtoken/integration_test.go @@ -2,9 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build integration - -package idtoken +package idtoken_test import ( "context" @@ -20,7 +18,7 @@ import ( ) const ( - envCredentialFile = "GCLOUD_TESTS_GOLANG_KEY" + envCredentialFile = "GOOGLE_APPLICATION_CREDENTIALS" aud = "http://example.com" ) @@ -29,7 +27,6 @@ func TestNewTokenSource(t *testing.T) { if testing.Short() { t.Skip("skipping integration test") } - os.Setenv(envCredentialFile, "/Users/codyoss/creds/codyoss-workspace-2b1fb7cd40c0.json") ts, err := idtoken.NewTokenSource(context.Background(), "http://example.com", option.WithCredentialsFile(os.Getenv(envCredentialFile))) if err != nil { t.Fatalf("unable to create TokenSource: %v", err) @@ -56,7 +53,6 @@ func TestNewClient_WithCredentialFile(t *testing.T) { if testing.Short() { t.Skip("skipping integration test") } - os.Setenv(envCredentialFile, "/Users/codyoss/creds/codyoss-workspace-2b1fb7cd40c0.json") client, err := idtoken.NewClient(context.Background(), aud, option.WithCredentialsFile(os.Getenv(envCredentialFile))) if err != nil { t.Fatalf("unable to create Client: %v", err) diff --git a/internal/kokoro/test.sh b/internal/kokoro/test.sh index 5fa58294a5c..9c6dfea580d 100755 --- a/internal/kokoro/test.sh +++ b/internal/kokoro/test.sh @@ -7,7 +7,7 @@ # Fail on any error set -eo pipefail -export GCLOUD_TESTS_GOLANG_KEY="${KOKORO_GFILE_DIR}/secret_manager/go-cloud-integration-service-account" +export GOOGLE_APPLICATION_CREDENTIALS="${KOKORO_GFILE_DIR}/secret_manager/go-cloud-integration-service-account" # Display commands being run set -x