Skip to content

Commit

Permalink
🚨 test(VSecM): 902 add test for url.go (#1072)
Browse files Browse the repository at this point in the history
Closes: 902

Signed-off-by: Omer Kocaoglu <[email protected]>
  • Loading branch information
omergk28 authored Jul 15, 2024
1 parent be73c0b commit f68bdec
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions core/log/rpc/url_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,26 @@
*/

package rpc

import (
"os"
"testing"
)

func TestSentinelLoggerUrl(t *testing.T) {
tests := []struct {
envValue string
expected string
}{
{"", "localhost:50051"},
{"testLoggerUrl", "testLoggerUrl"},
}

for _, test := range tests {
_ = os.Setenv("VSECM_SENTINEL_LOGGER_URL", test.envValue)
actual := SentinelLoggerUrl()
if actual != test.expected {
t.Errorf("SentinelLoggerUrl() with env value %q = %v; expected %v", test.envValue, actual, test.expected)
}
}
}

0 comments on commit f68bdec

Please sign in to comment.