mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
Add missing config test fixtures.
This commit is contained in:
parent
db5868f1b3
commit
39411b516d
|
@ -30,16 +30,16 @@ var configTests = []struct {
|
||||||
errContains string
|
errContains string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
inputFile: "minimal.conf",
|
inputFile: "minimal.conf.input",
|
||||||
printedFile: "minimal.conf.printed",
|
printedFile: "minimal.conf.printed",
|
||||||
}, {
|
}, {
|
||||||
inputFile: "sample.conf",
|
inputFile: "sample.conf.input",
|
||||||
printedFile: "sample.conf.printed",
|
printedFile: "sample.conf.printed",
|
||||||
}, {
|
}, {
|
||||||
// TODO: Options that are not provided should be set to sane defaults or
|
// TODO: Options that are not provided should be set to sane defaults or
|
||||||
// create errors during config loading (as appropriate). Right now, these
|
// create errors during config loading (as appropriate). Right now, these
|
||||||
// options remain at their zero-values, which is probably not what we want.
|
// options remain at their zero-values, which is probably not what we want.
|
||||||
inputFile: "empty.conf",
|
inputFile: "empty.conf.input",
|
||||||
printedFile: "empty.conf.printed",
|
printedFile: "empty.conf.printed",
|
||||||
},
|
},
|
||||||
// TODO: To enable testing of bad configs, we first need to change config
|
// TODO: To enable testing of bad configs, we first need to change config
|
||||||
|
@ -47,7 +47,7 @@ var configTests = []struct {
|
||||||
// configuration error should be passed back all the way to the caller.
|
// configuration error should be passed back all the way to the caller.
|
||||||
//
|
//
|
||||||
//{
|
//{
|
||||||
// inputFile: "bad_job_option.conf",
|
// inputFile: "bad_job_option.conf.input",
|
||||||
// shouldFail: true,
|
// shouldFail: true,
|
||||||
// errContains: "Missing job name",
|
// errContains: "Missing job name",
|
||||||
//},
|
//},
|
||||||
|
|
21
config/fixtures/bad_job_option.conf.input
Normal file
21
config/fixtures/bad_job_option.conf.input
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
global {
|
||||||
|
scrape_interval = "30s"
|
||||||
|
evaluation_interval = "30s"
|
||||||
|
labels {
|
||||||
|
monitor = "test"
|
||||||
|
}
|
||||||
|
rule_files = [
|
||||||
|
"prometheus.rules"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
job {
|
||||||
|
jobname = "prometheus"
|
||||||
|
scrape_interval = "15s"
|
||||||
|
|
||||||
|
targets {
|
||||||
|
endpoints = [
|
||||||
|
"http://localhost:9090/metrics.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
0
config/fixtures/empty.conf.input
Normal file
0
config/fixtures/empty.conf.input
Normal file
21
config/fixtures/minimal.conf.input
Normal file
21
config/fixtures/minimal.conf.input
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
global {
|
||||||
|
scrape_interval = "30s"
|
||||||
|
evaluation_interval = "30s"
|
||||||
|
labels {
|
||||||
|
monitor = "test"
|
||||||
|
}
|
||||||
|
rule_files = [
|
||||||
|
"prometheus.rules"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
job {
|
||||||
|
name = "prometheus"
|
||||||
|
scrape_interval = "15s"
|
||||||
|
|
||||||
|
targets {
|
||||||
|
endpoints = [
|
||||||
|
"http://localhost:9090/metrics.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
51
config/fixtures/sample.conf.input
Normal file
51
config/fixtures/sample.conf.input
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
global {
|
||||||
|
scrape_interval = "30s"
|
||||||
|
evaluation_interval = "30s"
|
||||||
|
labels {
|
||||||
|
monitor = "test"
|
||||||
|
}
|
||||||
|
rule_files = [
|
||||||
|
"prometheus.rules"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
job {
|
||||||
|
name = "prometheus"
|
||||||
|
scrape_interval = "15s"
|
||||||
|
|
||||||
|
targets {
|
||||||
|
endpoints = [
|
||||||
|
"http://localhost:9090/metrics.json"
|
||||||
|
]
|
||||||
|
labels {
|
||||||
|
group = "canary"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
job {
|
||||||
|
name = "random"
|
||||||
|
scrape_interval = "30s"
|
||||||
|
|
||||||
|
targets {
|
||||||
|
endpoints = [
|
||||||
|
"http://random.com:8080/metrics.json",
|
||||||
|
"http://random.com:8081/metrics.json",
|
||||||
|
"http://random.com:8082/metrics.json",
|
||||||
|
"http://random.com:8083/metrics.json",
|
||||||
|
"http://random.com:8084/metrics.json"
|
||||||
|
]
|
||||||
|
labels {
|
||||||
|
group = "production"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
targets {
|
||||||
|
endpoints = [
|
||||||
|
"http://random.com:8085/metrics.json",
|
||||||
|
"http://random.com:8086/metrics.json"
|
||||||
|
]
|
||||||
|
labels {
|
||||||
|
group = "canary"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue