Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize CLI flags to use host:port addresses #2212

Merged
merged 13 commits into from
May 19, 2020
Prev Previous commit
Next Next commit
cleanup tests
Signed-off-by: ohdearaugustin <j-reindl@live.at>
  • Loading branch information
ohdearaugustin committed May 15, 2020
commit 2697e681a98ac890866eb69c18bb4506f480fa43
12 changes: 0 additions & 12 deletions cmd/query/app/flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ func TestQueryBuilderFlags(t *testing.T) {
assert.Equal(t, "/dev/null", qOpts.StaticAssets)
assert.Equal(t, "some.json", qOpts.UIConfig)
assert.Equal(t, "/jaeger", qOpts.BasePath)
//assert.Equal(t, 80, qOpts.Port)
assert.Equal(t, "127.0.0.1:8080", qOpts.HostPort)
assert.Equal(t, http.Header{
"Access-Control-Allow-Origin": []string{"blerg"},
Expand All @@ -70,17 +69,6 @@ func TestQueryBuilderBadHeadersFlags(t *testing.T) {
assert.Nil(t, qOpts.AdditionalHeaders)
}

func TestQueryOptionsWithFlags_CheckHostPort(t *testing.T) {
q := &QueryOptions{}
v, command := config.Viperize(AddFlags)
command.ParseFlags([]string{
"--query.host-port=8080",
})
q.InitFromViper(v, zap.NewNop())

assert.Equal(t, ":8080", q.HostPort)
}

func TestStringSliceAsHeader(t *testing.T) {
headers := []string{
"Access-Control-Allow-Origin: https://mozilla.org",
Expand Down