@@ -20,7 +20,7 @@ func TestConfigApply(t *testing.T) {
2020 t .Parallel ()
2121
2222 fullConfig := Config {
23- URL : null .StringFrom ("some-url" ),
23+ ServerURL : null .StringFrom ("some-url" ),
2424 InsecureSkipTLSVerify : null .BoolFrom (false ),
2525 Username : null .StringFrom ("user" ),
2626 Password : null .StringFrom ("pass" ),
@@ -53,7 +53,7 @@ func TestConfigRemoteConfig(t *testing.T) {
5353 require .NoError (t , err )
5454
5555 config := Config {
56- URL : null .StringFrom (u .String ()),
56+ ServerURL : null .StringFrom (u .String ()),
5757 InsecureSkipTLSVerify : null .BoolFrom (true ),
5858 Username : null .StringFrom ("myuser" ),
5959 Password : null .StringFrom ("mypass" ),
@@ -98,7 +98,7 @@ func TestGetConsolidatedConfig(t *testing.T) {
9898 env : nil ,
9999 arg : "" ,
100100 config : Config {
101- URL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
101+ ServerURL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
102102 InsecureSkipTLSVerify : null .BoolFrom (true ),
103103 Username : null .NewString ("" , false ),
104104 Password : null .NewString ("" , false ),
@@ -110,7 +110,7 @@ func TestGetConsolidatedConfig(t *testing.T) {
110110 "JSONSuccess" : {
111111 jsonRaw : json .RawMessage (fmt .Sprintf (`{"url":"%s"}` , u .String ())),
112112 config : Config {
113- URL : null .StringFrom (u .String ()),
113+ ServerURL : null .StringFrom (u .String ()),
114114 InsecureSkipTLSVerify : null .BoolFrom (true ),
115115 Username : null .NewString ("" , false ),
116116 Password : null .NewString ("" , false ),
@@ -127,7 +127,7 @@ func TestGetConsolidatedConfig(t *testing.T) {
127127 },
128128 // arg: "username=user",
129129 config : Config {
130- URL : null .StringFrom (u .String ()),
130+ ServerURL : null .StringFrom (u .String ()),
131131 InsecureSkipTLSVerify : null .BoolFrom (false ),
132132 Username : null .NewString ("u" , true ),
133133 Password : null .NewString ("" , false ),
@@ -144,7 +144,7 @@ func TestGetConsolidatedConfig(t *testing.T) {
144144 },
145145 // arg: "password=arg",
146146 config : Config {
147- URL : null .StringFrom ("http://json:9090" ),
147+ ServerURL : null .StringFrom ("http://json:9090" ),
148148 InsecureSkipTLSVerify : null .BoolFrom (true ),
149149 Username : null .StringFrom ("env" ),
150150 Password : null .StringFrom ("env" ),
@@ -181,16 +181,16 @@ func TestGetConsolidatedConfig(t *testing.T) {
181181 }
182182}
183183
184- func TestParseURL (t * testing.T ) {
184+ func TestParseServerURL (t * testing.T ) {
185185 t .Parallel ()
186186
187187 c , err := parseArg ("url=http://prometheus.remote:3412/write" )
188188 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 )
190190
191191 c , err = parseArg ("url=http://prometheus.remote:3412/write,insecureSkipTLSVerify=false,pushInterval=2s" )
192192 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 )
194194 assert .Equal (t , null .BoolFrom (false ), c .InsecureSkipTLSVerify )
195195 assert .Equal (t , types .NullDurationFrom (time .Second * 2 ), c .PushInterval )
196196
@@ -199,7 +199,7 @@ func TestParseURL(t *testing.T) {
199199 assert .Equal (t , map [string ]string {"X-Header" : "value" }, c .Headers )
200200}
201201
202- func TestOptionURL (t * testing.T ) {
202+ func TestOptionServerURL (t * testing.T ) {
203203 t .Parallel ()
204204
205205 cases := map [string ]struct {
@@ -213,7 +213,7 @@ func TestOptionURL(t *testing.T) {
213213 }
214214
215215 expconfig := Config {
216- URL : null .StringFrom ("http://prometheus:9090/api/v1/write" ),
216+ ServerURL : null .StringFrom ("http://prometheus:9090/api/v1/write" ),
217217 InsecureSkipTLSVerify : null .BoolFrom (true ),
218218 Username : null .NewString ("" , false ),
219219 Password : null .NewString ("" , false ),
@@ -246,7 +246,7 @@ func TestOptionHeaders(t *testing.T) {
246246 }
247247
248248 expconfig := Config {
249- URL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
249+ ServerURL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
250250 InsecureSkipTLSVerify : null .BoolFrom (true ),
251251 PushInterval : types .NullDurationFrom (5 * time .Second ),
252252 Headers : map [string ]string {
@@ -280,7 +280,7 @@ func TestOptionInsecureSkipTLSVerify(t *testing.T) {
280280 }
281281
282282 expconfig := Config {
283- URL : null .StringFrom (defaultURL ),
283+ ServerURL : null .StringFrom (defaultServerURL ),
284284 InsecureSkipTLSVerify : null .BoolFrom (false ),
285285 PushInterval : types .NullDurationFrom (defaultPushInterval ),
286286 Headers : make (map [string ]string ),
@@ -311,7 +311,7 @@ func TestOptionBasicAuth(t *testing.T) {
311311 }
312312
313313 expconfig := Config {
314- URL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
314+ ServerURL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
315315 InsecureSkipTLSVerify : null .BoolFrom (true ),
316316 Username : null .StringFrom ("user1" ),
317317 Password : null .StringFrom ("pass1" ),
@@ -345,7 +345,7 @@ func TestOptionTrendAsNativeHistogram(t *testing.T) {
345345 }
346346
347347 expconfig := Config {
348- URL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
348+ ServerURL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
349349 InsecureSkipTLSVerify : null .BoolFrom (true ),
350350 Username : null .NewString ("" , false ),
351351 Password : null .NewString ("" , false ),
@@ -380,7 +380,7 @@ func TestOptionPushInterval(t *testing.T) {
380380 }
381381
382382 expconfig := Config {
383- URL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
383+ ServerURL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
384384 InsecureSkipTLSVerify : null .BoolFrom (true ),
385385 Username : null .NewString ("" , false ),
386386 Password : null .NewString ("" , false ),
@@ -415,7 +415,7 @@ func TestConfigTrendStats(t *testing.T) {
415415 }
416416
417417 expconfig := Config {
418- URL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
418+ ServerURL : null .StringFrom ("http://localhost:9090/api/v1/write" ),
419419 InsecureSkipTLSVerify : null .BoolFrom (true ),
420420 PushInterval : types .NullDurationFrom (5 * time .Second ),
421421 Headers : make (map [string ]string ),
0 commit comments