Skip to content

Commit 7acbf74

Browse files
author
Po-Yao Chen
committed
update comment
1 parent 64a6c7e commit 7acbf74

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

otellib/otel_test.go

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,9 @@ func TestInitOTelSDK(t *testing.T) {
148148
RootCAs: crtPool,
149149
}
150150

151-
// HTTP endpoint test case.
152-
t.Run("should initialize with HTTP endpoint", func(t *testing.T) {
153-
// Create a mock HTTP server that the exporter can connect to
151+
t.Run("HTTP endpoint test case", func(t *testing.T) {
154152
httpServer := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
155-
w.WriteHeader(http.StatusOK) // Respond with success
153+
w.WriteHeader(http.StatusOK)
156154
}))
157155
defer httpServer.Close()
158156

@@ -167,9 +165,7 @@ func TestInitOTelSDK(t *testing.T) {
167165
require.NoError(t, err, "Shutdown should not produce an error")
168166
})
169167

170-
// gRPC endpoint test case.
171-
t.Run("should initialize with gRPC endpoint", func(t *testing.T) {
172-
// Create a listener on a random available port
168+
t.Run("gRPC endpoint test case", func(t *testing.T) {
173169
lis, err := net.Listen("tcp", "127.0.0.1:0")
174170
require.NoError(t, err)
175171

@@ -190,10 +186,10 @@ func TestInitOTelSDK(t *testing.T) {
190186
require.NoError(t, err)
191187
})
192188

193-
t.Run("should fail with an unreachable endpoint", func(t *testing.T) {
189+
t.Run("unreachable endpoint", func(t *testing.T) {
194190
invalidEndpoint := "localhost:99999"
195191
shutdown := InitOTelSDK(ctx, invalidEndpoint, &tls.Config{}, oTelRes)
196192

197-
require.NotNil(t, shutdown, "Function should still return a function on failure")
193+
require.NotNil(t, shutdown, "should return failure")
198194
})
199195
}

0 commit comments

Comments
 (0)