@@ -20,7 +20,7 @@ func TestConfigApply(t *testing.T) {
20
20
t .Parallel ()
21
21
22
22
fullConfig := Config {
23
- URL : null .StringFrom ("some-url" ),
23
+ ServerURL : null .StringFrom ("some-url" ),
24
24
InsecureSkipTLSVerify : null .BoolFrom (false ),
25
25
Username : null .StringFrom ("user" ),
26
26
Password : null .StringFrom ("pass" ),
@@ -53,7 +53,7 @@ func TestConfigRemoteConfig(t *testing.T) {
53
53
require .NoError (t , err )
54
54
55
55
config := Config {
56
- URL : null .StringFrom (u .String ()),
56
+ ServerURL : null .StringFrom (u .String ()),
57
57
InsecureSkipTLSVerify : null .BoolFrom (true ),
58
58
Username : null .StringFrom ("myuser" ),
59
59
Password : null .StringFrom ("mypass" ),
@@ -98,7 +98,7 @@ func TestGetConsolidatedConfig(t *testing.T) {
98
98
env : nil ,
99
99
arg : "" ,
100
100
config : Config {
101
- URL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
101
+ ServerURL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
102
102
InsecureSkipTLSVerify : null .BoolFrom (true ),
103
103
Username : null .NewString ("" , false ),
104
104
Password : null .NewString ("" , false ),
@@ -110,7 +110,7 @@ func TestGetConsolidatedConfig(t *testing.T) {
110
110
"JSONSuccess" : {
111
111
jsonRaw : json .RawMessage (fmt .Sprintf (`{"url":"%s"}` , u .String ())),
112
112
config : Config {
113
- URL : null .StringFrom (u .String ()),
113
+ ServerURL : null .StringFrom (u .String ()),
114
114
InsecureSkipTLSVerify : null .BoolFrom (true ),
115
115
Username : null .NewString ("" , false ),
116
116
Password : null .NewString ("" , false ),
@@ -127,7 +127,7 @@ func TestGetConsolidatedConfig(t *testing.T) {
127
127
},
128
128
// arg: "username=user",
129
129
config : Config {
130
- URL : null .StringFrom (u .String ()),
130
+ ServerURL : null .StringFrom (u .String ()),
131
131
InsecureSkipTLSVerify : null .BoolFrom (false ),
132
132
Username : null .NewString ("u" , true ),
133
133
Password : null .NewString ("" , false ),
@@ -144,7 +144,7 @@ func TestGetConsolidatedConfig(t *testing.T) {
144
144
},
145
145
// arg: "password=arg",
146
146
config : Config {
147
- URL : null .StringFrom ("http://json:9090" ),
147
+ ServerURL : null .StringFrom ("http://json:9090" ),
148
148
InsecureSkipTLSVerify : null .BoolFrom (true ),
149
149
Username : null .StringFrom ("env" ),
150
150
Password : null .StringFrom ("env" ),
@@ -181,16 +181,16 @@ func TestGetConsolidatedConfig(t *testing.T) {
181
181
}
182
182
}
183
183
184
- func TestParseURL (t * testing.T ) {
184
+ func TestParseServerURL (t * testing.T ) {
185
185
t .Parallel ()
186
186
187
187
c , err := parseArg ("url=http://prometheus.remote:3412/write" )
188
188
assert .Nil (t , err )
189
- assert .Equal (t , null .StringFrom ("http://prometheus.remote:3412/write" ), c .URL )
189
+ assert .Equal (t , null .StringFrom ("http://prometheus.remote:3412/write" ), c .ServerURL )
190
190
191
191
c , err = parseArg ("url=http://prometheus.remote:3412/write,insecureSkipTLSVerify=false,pushInterval=2s" )
192
192
assert .Nil (t , err )
193
- assert .Equal (t , null .StringFrom ("http://prometheus.remote:3412/write" ), c .URL )
193
+ assert .Equal (t , null .StringFrom ("http://prometheus.remote:3412/write" ), c .ServerURL )
194
194
assert .Equal (t , null .BoolFrom (false ), c .InsecureSkipTLSVerify )
195
195
assert .Equal (t , types .NullDurationFrom (time .Second * 2 ), c .PushInterval )
196
196
@@ -199,7 +199,7 @@ func TestParseURL(t *testing.T) {
199
199
assert .Equal (t , map [string ]string {"X-Header" : "value" }, c .Headers )
200
200
}
201
201
202
- func TestOptionURL (t * testing.T ) {
202
+ func TestOptionServerURL (t * testing.T ) {
203
203
t .Parallel ()
204
204
205
205
cases := map [string ]struct {
@@ -213,7 +213,7 @@ func TestOptionURL(t *testing.T) {
213
213
}
214
214
215
215
expconfig := Config {
216
- URL : null .StringFrom ("http://prometheus:9090/api/v1/write" ),
216
+ ServerURL : null .StringFrom ("http://prometheus:9090/api/v1/write" ),
217
217
InsecureSkipTLSVerify : null .BoolFrom (true ),
218
218
Username : null .NewString ("" , false ),
219
219
Password : null .NewString ("" , false ),
@@ -246,7 +246,7 @@ func TestOptionHeaders(t *testing.T) {
246
246
}
247
247
248
248
expconfig := Config {
249
- URL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
249
+ ServerURL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
250
250
InsecureSkipTLSVerify : null .BoolFrom (true ),
251
251
PushInterval : types .NullDurationFrom (5 * time .Second ),
252
252
Headers : map [string ]string {
@@ -280,7 +280,7 @@ func TestOptionInsecureSkipTLSVerify(t *testing.T) {
280
280
}
281
281
282
282
expconfig := Config {
283
- URL : null .StringFrom (defaultURL ),
283
+ ServerURL : null .StringFrom (defaultServerURL ),
284
284
InsecureSkipTLSVerify : null .BoolFrom (false ),
285
285
PushInterval : types .NullDurationFrom (defaultPushInterval ),
286
286
Headers : make (map [string ]string ),
@@ -311,7 +311,7 @@ func TestOptionBasicAuth(t *testing.T) {
311
311
}
312
312
313
313
expconfig := Config {
314
- URL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
314
+ ServerURL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
315
315
InsecureSkipTLSVerify : null .BoolFrom (true ),
316
316
Username : null .StringFrom ("user1" ),
317
317
Password : null .StringFrom ("pass1" ),
@@ -345,7 +345,7 @@ func TestOptionTrendAsNativeHistogram(t *testing.T) {
345
345
}
346
346
347
347
expconfig := Config {
348
- URL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
348
+ ServerURL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
349
349
InsecureSkipTLSVerify : null .BoolFrom (true ),
350
350
Username : null .NewString ("" , false ),
351
351
Password : null .NewString ("" , false ),
@@ -380,7 +380,7 @@ func TestOptionPushInterval(t *testing.T) {
380
380
}
381
381
382
382
expconfig := Config {
383
- URL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
383
+ ServerURL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
384
384
InsecureSkipTLSVerify : null .BoolFrom (true ),
385
385
Username : null .NewString ("" , false ),
386
386
Password : null .NewString ("" , false ),
@@ -415,7 +415,7 @@ func TestConfigTrendStats(t *testing.T) {
415
415
}
416
416
417
417
expconfig := Config {
418
- URL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
418
+ ServerURL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
419
419
InsecureSkipTLSVerify : null .BoolFrom (true ),
420
420
PushInterval : types .NullDurationFrom (5 * time .Second ),
421
421
Headers : make (map [string ]string ),
0 commit comments