mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-10 07:34:04 -08:00
Cleanup cluttered test data
This commit is contained in:
parent
65eba080a0
commit
0d44248fb8
|
@ -313,44 +313,109 @@ func TestTargetManagerConfigUpdate(t *testing.T) {
|
|||
scrapeConfigs: []*config.ScrapeConfig{testJob1},
|
||||
expected: map[string][]model.LabelSet{
|
||||
"test_job1:static:0:0": {
|
||||
{model.JobLabel: "test_job1", model.InstanceLabel: "example.org:80", "testParam": "paramValue",
|
||||
model.SchemeLabel: "", model.MetricsPathLabel: "", model.AddressLabel: "example.org:80", model.ParamLabelPrefix + "testParam": "paramValue"},
|
||||
{model.JobLabel: "test_job1", model.InstanceLabel: "example.com:80", "testParam": "paramValue",
|
||||
model.SchemeLabel: "", model.MetricsPathLabel: "", model.AddressLabel: "example.com:80", model.ParamLabelPrefix + "testParam": "paramValue"},
|
||||
{
|
||||
model.JobLabel: "test_job1",
|
||||
model.InstanceLabel: "example.org:80",
|
||||
"testParam": "paramValue",
|
||||
model.SchemeLabel: "",
|
||||
model.MetricsPathLabel: "",
|
||||
model.AddressLabel: "example.org:80",
|
||||
model.ParamLabelPrefix + "testParam": "paramValue",
|
||||
},
|
||||
{
|
||||
model.JobLabel: "test_job1",
|
||||
model.InstanceLabel: "example.com:80",
|
||||
"testParam": "paramValue",
|
||||
model.SchemeLabel: "",
|
||||
model.MetricsPathLabel: "",
|
||||
model.AddressLabel: "example.com:80",
|
||||
model.ParamLabelPrefix + "testParam": "paramValue"},
|
||||
},
|
||||
},
|
||||
}, {
|
||||
scrapeConfigs: []*config.ScrapeConfig{testJob1},
|
||||
expected: map[string][]model.LabelSet{
|
||||
"test_job1:static:0:0": {
|
||||
{model.JobLabel: "test_job1", model.InstanceLabel: "example.org:80", "testParam": "paramValue",
|
||||
model.SchemeLabel: "", model.MetricsPathLabel: "", model.AddressLabel: "example.org:80", model.ParamLabelPrefix + "testParam": "paramValue"},
|
||||
{model.JobLabel: "test_job1", model.InstanceLabel: "example.com:80", "testParam": "paramValue",
|
||||
model.SchemeLabel: "", model.MetricsPathLabel: "", model.AddressLabel: "example.com:80", model.ParamLabelPrefix + "testParam": "paramValue"},
|
||||
{
|
||||
model.JobLabel: "test_job1",
|
||||
model.InstanceLabel: "example.org:80",
|
||||
"testParam": "paramValue",
|
||||
model.SchemeLabel: "",
|
||||
model.MetricsPathLabel: "",
|
||||
model.AddressLabel: "example.org:80",
|
||||
model.ParamLabelPrefix + "testParam": "paramValue",
|
||||
},
|
||||
{
|
||||
model.JobLabel: "test_job1",
|
||||
model.InstanceLabel: "example.com:80",
|
||||
"testParam": "paramValue",
|
||||
model.SchemeLabel: "",
|
||||
model.MetricsPathLabel: "",
|
||||
model.AddressLabel: "example.com:80",
|
||||
model.ParamLabelPrefix + "testParam": "paramValue",
|
||||
},
|
||||
},
|
||||
},
|
||||
}, {
|
||||
scrapeConfigs: []*config.ScrapeConfig{testJob1, testJob2},
|
||||
expected: map[string][]model.LabelSet{
|
||||
"test_job1:static:0:0": {
|
||||
{model.JobLabel: "test_job1", model.InstanceLabel: "example.org:80", "testParam": "paramValue",
|
||||
model.SchemeLabel: "", model.MetricsPathLabel: "", model.AddressLabel: "example.org:80", model.ParamLabelPrefix + "testParam": "paramValue"},
|
||||
{model.JobLabel: "test_job1", model.InstanceLabel: "example.com:80", "testParam": "paramValue",
|
||||
model.SchemeLabel: "", model.MetricsPathLabel: "", model.AddressLabel: "example.com:80", model.ParamLabelPrefix + "testParam": "paramValue"},
|
||||
{
|
||||
model.JobLabel: "test_job1",
|
||||
model.InstanceLabel: "example.org:80",
|
||||
"testParam": "paramValue",
|
||||
model.SchemeLabel: "",
|
||||
model.MetricsPathLabel: "",
|
||||
model.AddressLabel: "example.org:80",
|
||||
model.ParamLabelPrefix + "testParam": "paramValue",
|
||||
},
|
||||
{
|
||||
model.JobLabel: "test_job1",
|
||||
model.InstanceLabel: "example.com:80",
|
||||
"testParam": "paramValue",
|
||||
model.SchemeLabel: "",
|
||||
model.MetricsPathLabel: "",
|
||||
model.AddressLabel: "example.com:80",
|
||||
model.ParamLabelPrefix + "testParam": "paramValue",
|
||||
},
|
||||
},
|
||||
"test_job2:static:0:0": {
|
||||
{model.JobLabel: "test_job2", model.InstanceLabel: "example.org:8080", "foo": "bar", "new": "ox-ba",
|
||||
model.SchemeLabel: "", model.MetricsPathLabel: "", model.AddressLabel: "example.org:8080"},
|
||||
{model.JobLabel: "test_job2", model.InstanceLabel: "example.com:8081", "foo": "bar", "new": "ox-ba",
|
||||
model.SchemeLabel: "", model.MetricsPathLabel: "", model.AddressLabel: "example.com:8081"},
|
||||
{
|
||||
model.JobLabel: "test_job2",
|
||||
model.InstanceLabel: "example.org:8080",
|
||||
"foo": "bar",
|
||||
"new": "ox-ba",
|
||||
model.SchemeLabel: "",
|
||||
model.MetricsPathLabel: "",
|
||||
model.AddressLabel: "example.org:8080",
|
||||
},
|
||||
{
|
||||
model.JobLabel: "test_job2",
|
||||
model.InstanceLabel: "example.com:8081",
|
||||
"foo": "bar",
|
||||
"new": "ox-ba",
|
||||
model.SchemeLabel: "",
|
||||
model.MetricsPathLabel: "",
|
||||
model.AddressLabel: "example.com:8081",
|
||||
},
|
||||
},
|
||||
"test_job2:static:0:1": {
|
||||
{model.JobLabel: "test_job2", model.InstanceLabel: "foo.com:1234",
|
||||
model.SchemeLabel: "", model.MetricsPathLabel: "", model.AddressLabel: "foo.com:1234"},
|
||||
{
|
||||
model.JobLabel: "test_job2",
|
||||
model.InstanceLabel: "foo.com:1234",
|
||||
model.SchemeLabel: "",
|
||||
model.MetricsPathLabel: "",
|
||||
model.AddressLabel: "foo.com:1234",
|
||||
},
|
||||
},
|
||||
"test_job2:static:0:2": {
|
||||
{model.JobLabel: "test_job2", model.InstanceLabel: "fixed",
|
||||
model.SchemeLabel: "", model.MetricsPathLabel: "", model.AddressLabel: "foo.com:1235"},
|
||||
{
|
||||
model.JobLabel: "test_job2",
|
||||
model.InstanceLabel: "fixed",
|
||||
model.SchemeLabel: "",
|
||||
model.MetricsPathLabel: "",
|
||||
model.AddressLabel: "foo.com:1235",
|
||||
},
|
||||
},
|
||||
},
|
||||
}, {
|
||||
|
@ -360,18 +425,41 @@ func TestTargetManagerConfigUpdate(t *testing.T) {
|
|||
scrapeConfigs: []*config.ScrapeConfig{testJob2},
|
||||
expected: map[string][]model.LabelSet{
|
||||
"test_job2:static:0:0": {
|
||||
{model.JobLabel: "test_job2", model.InstanceLabel: "example.org:8080", "foo": "bar", "new": "ox-ba",
|
||||
model.SchemeLabel: "", model.MetricsPathLabel: "", model.AddressLabel: "example.org:8080"},
|
||||
{model.JobLabel: "test_job2", model.InstanceLabel: "example.com:8081", "foo": "bar", "new": "ox-ba",
|
||||
model.SchemeLabel: "", model.MetricsPathLabel: "", model.AddressLabel: "example.com:8081"},
|
||||
{
|
||||
model.JobLabel: "test_job2",
|
||||
model.InstanceLabel: "example.org:8080",
|
||||
"foo": "bar",
|
||||
"new": "ox-ba",
|
||||
model.SchemeLabel: "",
|
||||
model.MetricsPathLabel: "",
|
||||
model.AddressLabel: "example.org:8080"},
|
||||
{
|
||||
model.JobLabel: "test_job2",
|
||||
model.InstanceLabel: "example.com:8081",
|
||||
"foo": "bar",
|
||||
"new": "ox-ba",
|
||||
model.SchemeLabel: "",
|
||||
model.MetricsPathLabel: "",
|
||||
model.AddressLabel: "example.com:8081",
|
||||
},
|
||||
},
|
||||
"test_job2:static:0:1": {
|
||||
{model.JobLabel: "test_job2", model.InstanceLabel: "foo.com:1234",
|
||||
model.SchemeLabel: "", model.MetricsPathLabel: "", model.AddressLabel: "foo.com:1234"},
|
||||
{
|
||||
model.JobLabel: "test_job2",
|
||||
model.InstanceLabel: "foo.com:1234",
|
||||
model.SchemeLabel: "",
|
||||
model.MetricsPathLabel: "",
|
||||
model.AddressLabel: "foo.com:1234",
|
||||
},
|
||||
},
|
||||
"test_job2:static:0:2": {
|
||||
{model.JobLabel: "test_job2", model.InstanceLabel: "fixed",
|
||||
model.SchemeLabel: "", model.MetricsPathLabel: "", model.AddressLabel: "foo.com:1235"},
|
||||
{
|
||||
model.JobLabel: "test_job2",
|
||||
model.InstanceLabel: "fixed",
|
||||
model.SchemeLabel: "",
|
||||
model.MetricsPathLabel: "",
|
||||
model.AddressLabel: "foo.com:1235",
|
||||
},
|
||||
},
|
||||
},
|
||||
}, {
|
||||
|
|
Loading…
Reference in a new issue