Add missing config test fixtures.

This commit is contained in:
Julius Volz 2013-02-17 01:01:50 +01:00
parent db5868f1b3
commit 39411b516d
5 changed files with 97 additions and 4 deletions

View file

@ -30,16 +30,16 @@ var configTests = []struct {
errContains string
}{
{
inputFile: "minimal.conf",
inputFile: "minimal.conf.input",
printedFile: "minimal.conf.printed",
}, {
inputFile: "sample.conf",
inputFile: "sample.conf.input",
printedFile: "sample.conf.printed",
}, {
// TODO: Options that are not provided should be set to sane defaults or
// create errors during config loading (as appropriate). Right now, these
// options remain at their zero-values, which is probably not what we want.
inputFile: "empty.conf",
inputFile: "empty.conf.input",
printedFile: "empty.conf.printed",
},
// 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.
//
//{
// inputFile: "bad_job_option.conf",
// inputFile: "bad_job_option.conf.input",
// shouldFail: true,
// errContains: "Missing job name",
//},

View 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"
]
}
}

View file

View 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"
]
}
}

View 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"
}
}
}