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


##########
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:
   After we moved the core logic of `GetUniverseDomain` and `GetGcsEndpoint` 
away from `options.go`, I think `universe_test.go` is no longer needed. 
`TestGetUniverseDomain` is trivial and `TestGetGcsEndpoint` should go inside 
the core logic in gcsx. WDYT?



-- 
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