Merge pull request #14463 from fpetkovski/customize-acceptance-tests

Allow built-in tests to be customized
pull/14472/head
Bryan Boreham 5 months ago committed by GitHub
commit bb241d7960
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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…
Cancel
Save