mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
Allow built-in tests to be customized
The RunBuiltinTests function accepts a concrete type which makes it hard to exclude certain tests from the suite. It would be great if we could skip tests which might not be critical in order to unblock updates. By accepting an interface instead, we can inject a custom implementation which would skips select test cases. Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
This commit is contained in:
parent
58963f7b2e
commit
cb8b6d7504
|
@ -55,6 +55,11 @@ const (
|
|||
DefaultMaxSamplesPerQuery = 10000
|
||||
)
|
||||
|
||||
type TBRun interface {
|
||||
testing.TB
|
||||
Run(string, func(*testing.T)) bool
|
||||
}
|
||||
|
||||
var testStartTime = time.Unix(0, 0).UTC()
|
||||
|
||||
// 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.
|
||||
func RunBuiltinTests(t *testing.T, engine promql.QueryEngine) {
|
||||
func RunBuiltinTests(t TBRun, engine promql.QueryEngine) {
|
||||
t.Cleanup(func() { parser.EnableExperimentalFunctions = false })
|
||||
parser.EnableExperimentalFunctions = true
|
||||
|
||||
|
|
Loading…
Reference in a new issue