diff options
author | 2020-11-10 20:03:14 +0100 | |
---|---|---|
committer | 2020-11-10 19:03:14 +0000 | |
commit | b7814204a49f05ecb9f5920bb28038b0f09e4cd8 (patch) | |
tree | d5a999b7e096a7b95fc0cd6cb358b4f7ed907ff9 /plugin/trace/setup_test.go | |
parent | dd2a1bfc82ea340e96b2a6639b836fba699bf807 (diff) | |
download | coredns-b7814204a49f05ecb9f5920bb28038b0f09e4cd8.tar.gz coredns-b7814204a49f05ecb9f5920bb28038b0f09e4cd8.tar.zst coredns-b7814204a49f05ecb9f5920bb28038b0f09e4cd8.zip |
plugin/trace: Fix zipkin json_v2 (#4180)
Automatically submitted.
Diffstat (limited to 'plugin/trace/setup_test.go')
-rw-r--r-- | plugin/trace/setup_test.go | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/plugin/trace/setup_test.go b/plugin/trace/setup_test.go index 1e3baaf4b..bbc5f987f 100644 --- a/plugin/trace/setup_test.go +++ b/plugin/trace/setup_test.go @@ -16,17 +16,17 @@ func TestTraceParse(t *testing.T) { clientServer bool }{ // oks - {`trace`, false, "http://localhost:9411/api/v1/spans", 1, `coredns`, false}, - {`trace localhost:1234`, false, "http://localhost:1234/api/v1/spans", 1, `coredns`, false}, + {`trace`, false, "http://localhost:9411/api/v2/spans", 1, `coredns`, false}, + {`trace localhost:1234`, false, "http://localhost:1234/api/v2/spans", 1, `coredns`, false}, {`trace http://localhost:1234/somewhere/else`, false, "http://localhost:1234/somewhere/else", 1, `coredns`, false}, - {`trace zipkin localhost:1234`, false, "http://localhost:1234/api/v1/spans", 1, `coredns`, false}, + {`trace zipkin localhost:1234`, false, "http://localhost:1234/api/v2/spans", 1, `coredns`, false}, {`trace datadog localhost`, false, "localhost", 1, `coredns`, false}, {`trace datadog http://localhost:8127`, false, "http://localhost:8127", 1, `coredns`, false}, {"trace datadog localhost {\n datadog_analytics_rate 0.1\n}", false, "localhost", 1, `coredns`, false}, - {"trace {\n every 100\n}", false, "http://localhost:9411/api/v1/spans", 100, `coredns`, false}, - {"trace {\n every 100\n service foobar\nclient_server\n}", false, "http://localhost:9411/api/v1/spans", 100, `foobar`, true}, - {"trace {\n every 2\n client_server true\n}", false, "http://localhost:9411/api/v1/spans", 2, `coredns`, true}, - {"trace {\n client_server false\n}", false, "http://localhost:9411/api/v1/spans", 1, `coredns`, false}, + {"trace {\n every 100\n}", false, "http://localhost:9411/api/v2/spans", 100, `coredns`, false}, + {"trace {\n every 100\n service foobar\nclient_server\n}", false, "http://localhost:9411/api/v2/spans", 100, `foobar`, true}, + {"trace {\n every 2\n client_server true\n}", false, "http://localhost:9411/api/v2/spans", 2, `coredns`, true}, + {"trace {\n client_server false\n}", false, "http://localhost:9411/api/v2/spans", 1, `coredns`, false}, // fails {`trace footype localhost:4321`, true, "", 1, "", false}, {"trace {\n every 2\n client_server junk\n}", true, "", 1, "", false}, @@ -47,6 +47,9 @@ func TestTraceParse(t *testing.T) { continue } + if "" != m.serviceEndpoint { + t.Errorf("Test %v: Expected serviceEndpoint to be '' but found: %s", i, m.serviceEndpoint) + } if test.endpoint != m.Endpoint { t.Errorf("Test %v: Expected endpoint %s but found: %s", i, test.endpoint, m.Endpoint) } |