mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-12 16:44:05 -08:00
Merge pull request #14463 from fpetkovski/customize-acceptance-tests
Allow built-in tests to be customized
This commit is contained in:
commit
bb241d7960
|
@ -55,6 +55,11 @@ const (
|
||||||
DefaultMaxSamplesPerQuery = 10000
|
DefaultMaxSamplesPerQuery = 10000
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type TBRun interface {
|
||||||
|
testing.TB
|
||||||
|
Run(string, func(*testing.T)) bool
|
||||||
|
}
|
||||||
|
|
||||||
var testStartTime = time.Unix(0, 0).UTC()
|
var testStartTime = time.Unix(0, 0).UTC()
|
||||||
|
|
||||||
// LoadedStorage returns storage with generated data using the provided load statements.
|
// LoadedStorage returns storage with generated data using the provided load statements.
|
||||||
|
@ -89,7 +94,7 @@ func NewTestEngine(enablePerStepStats bool, lookbackDelta time.Duration, maxSamp
|
||||||
}
|
}
|
||||||
|
|
||||||
// RunBuiltinTests runs an acceptance test suite against the provided engine.
|
// RunBuiltinTests runs an acceptance test suite against the provided engine.
|
||||||
func RunBuiltinTests(t *testing.T, engine promql.QueryEngine) {
|
func RunBuiltinTests(t TBRun, engine promql.QueryEngine) {
|
||||||
t.Cleanup(func() { parser.EnableExperimentalFunctions = false })
|
t.Cleanup(func() { parser.EnableExperimentalFunctions = false })
|
||||||
parser.EnableExperimentalFunctions = true
|
parser.EnableExperimentalFunctions = true
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue