derrickaw commented on code in PR #40729:
URL: https://github.com/apache/beam/pull/40729#discussion_r4361577035


##########
sdks/go/pkg/beam/options/gcpopts/universe_test.go:
##########
@@ -16,85 +16,16 @@
 package gcpopts
 
 import (
-       "context"
-       "errors"
        "testing"
 
        "github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime"
-       "golang.org/x/oauth2/google"
 )
 
 func TestGetUniverseDomain(t *testing.T) {
-       tests := []struct {
-               name      string
-               env       string
-               credsUD   string
-               credsErr  error
-               want      string
-               wantCalls int // credential lookups across two calls
-       }{
-               {
-                       name:    "env var takes precedence",
-                       env:     "env.example.com",
-                       credsUD: "creds.example.com",
-                       want:    "env.example.com",
-               },
-               {
-                       name:      "falls back to credentials and caches",
-                       credsUD:   "creds.example.com",
-                       want:      "creds.example.com",
-                       wantCalls: 1,
-               },
-               {
-                       name:      "credential errors are not cached",
-                       credsErr:  errors.New("no credentials"),
-                       want:      "",
-                       wantCalls: 2,
-               },
+       t.Setenv("GOOGLE_CLOUD_UNIVERSE_DOMAIN", "env.example.com")
+       if got, want := GetUniverseDomain(t.Context()), "env.example.com"; got 
!= want {

Review Comment:
   Yea, good points. I removed universe_test.go, deleted 
`TestGetUniverseDomain` and shifted `TestGetGcsEndpoint` as you suggested. 
Thanks.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to