mirror of
https://github.com/prometheus/prometheus.git
synced 2025-02-02 08:31:11 -08:00
refine test cases according to spec
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
This commit is contained in:
parent
de9de320a4
commit
050b5fc257
|
@ -3760,27 +3760,27 @@ metric: <
|
||||||
} {
|
} {
|
||||||
var expectedClassicHistCount, expectedNativeHistCount int
|
var expectedClassicHistCount, expectedNativeHistCount int
|
||||||
var expectCustomBuckets bool
|
var expectCustomBuckets bool
|
||||||
switch {
|
|
||||||
case tc.scrapeClassicHistograms && tc.convertClassicHistograms:
|
|
||||||
expectedClassicHistCount = 1
|
|
||||||
expectedNativeHistCount = 1
|
|
||||||
expectCustomBuckets = true
|
|
||||||
case !tc.scrapeClassicHistograms && tc.convertClassicHistograms:
|
|
||||||
expectedClassicHistCount = 0
|
|
||||||
expectedNativeHistCount = 1
|
|
||||||
expectCustomBuckets = true
|
|
||||||
case tc.scrapeClassicHistograms && !tc.convertClassicHistograms:
|
|
||||||
expectedClassicHistCount = 1
|
|
||||||
expectedNativeHistCount = 0
|
|
||||||
case !tc.scrapeClassicHistograms && !tc.convertClassicHistograms:
|
|
||||||
expectedClassicHistCount = 1 // since these are sent without native histograms
|
|
||||||
expectedNativeHistCount = 0
|
|
||||||
}
|
|
||||||
if metricsText.hasExponential {
|
if metricsText.hasExponential {
|
||||||
expectedNativeHistCount = 1
|
expectedNativeHistCount = 1
|
||||||
expectCustomBuckets = false
|
expectCustomBuckets = false
|
||||||
} else {
|
expectedClassicHistCount = 0
|
||||||
expectCustomBuckets = true
|
if metricsText.hasClassic && tc.scrapeClassicHistograms {
|
||||||
|
expectedClassicHistCount = 1
|
||||||
|
}
|
||||||
|
} else if metricsText.hasClassic {
|
||||||
|
switch {
|
||||||
|
case tc.scrapeClassicHistograms && tc.convertClassicHistograms:
|
||||||
|
expectedClassicHistCount = 1
|
||||||
|
expectedNativeHistCount = 1
|
||||||
|
expectCustomBuckets = true
|
||||||
|
case !tc.scrapeClassicHistograms && tc.convertClassicHistograms:
|
||||||
|
expectedClassicHistCount = 0
|
||||||
|
expectedNativeHistCount = 1
|
||||||
|
expectCustomBuckets = true
|
||||||
|
case !tc.convertClassicHistograms:
|
||||||
|
expectedClassicHistCount = 1
|
||||||
|
expectedNativeHistCount = 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
t.Run(fmt.Sprintf("%s with %s", name, metricsTextName), func(t *testing.T) {
|
t.Run(fmt.Sprintf("%s with %s", name, metricsTextName), func(t *testing.T) {
|
||||||
|
|
Loading…
Reference in a new issue