MCPcopy
hub / github.com/grafana/tempo / TestGetContainerClient

Function TestGetContainerClient

tempodb/backend/azure/azure_helpers_test.go:68–111  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

66}
67
68func TestGetContainerClient(t *testing.T) {
69 cfg := Config{
70 StorageAccountName: "devstoreaccount1",
71 StorageAccountKey: flagext.SecretWithValue("dGVzdAo="),
72 ContainerName: "traces",
73 }
74
75 tests := []struct {
76 name string
77 endpoint string
78 expectedURL string
79 }{
80 {
81 name: "localhost",
82 endpoint: "localhost:10000",
83 expectedURL: "http://localhost:10000/devstoreaccount1/traces",
84 },
85 {
86 name: "Azure China",
87 endpoint: "blob.core.chinacloudapi.cn",
88 expectedURL: "https://devstoreaccount1.blob.core.chinacloudapi.cn/traces",
89 },
90 {
91 name: "Azure US Government",
92 endpoint: "blob.core.usgovcloudapi.net",
93 expectedURL: "https://devstoreaccount1.blob.core.usgovcloudapi.net/traces",
94 },
95 {
96 name: "Azure German",
97 endpoint: "blob.core.cloudapi.de",
98 expectedURL: "https://devstoreaccount1.blob.core.cloudapi.de/traces",
99 },
100 }
101
102 for _, tc := range tests {
103 t.Run(tc.name, func(t *testing.T) {
104 cfg.Endpoint = tc.endpoint
105
106 client, err := getContainerClient(context.Background(), &cfg, false)
107 assert.NoError(t, err)
108 assert.Equal(t, tc.expectedURL, client.URL())
109 })
110 }
111}

Callers

nothing calls this directly

Calls 3

getContainerClientFunction · 0.85
RunMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected