@@ -24,6 +24,7 @@ import (
2424 "github.com/prometheus/prometheus/model/histogram"
2525 "github.com/prometheus/prometheus/model/labels"
2626 "github.com/prometheus/prometheus/model/timestamp"
27+ "github.com/prometheus/prometheus/model/validation"
2728 "github.com/prometheus/prometheus/promql"
2829 "github.com/prometheus/prometheus/promql/parser"
2930 "github.com/prometheus/prometheus/promql/parser/posrange"
@@ -3207,7 +3208,7 @@ func TestQueryStats(t *testing.T) {
32073208 runQueryAndGetSamplesStats := func (t * testing.T , engine promql.QueryEngine , expr string , isInstantQuery bool ) * promstats.QuerySamples {
32083209 var q promql.Query
32093210 var err error
3210- opts := promql .NewPrometheusQueryOpts (true , 0 )
3211+ opts := promql .NewPrometheusQueryOpts (true , 0 , validation . LegacyNamingScheme )
32113212 if isInstantQuery {
32123213 q , err = engine .NewInstantQuery (context .Background (), storage , opts , expr , end )
32133214 } else {
@@ -3501,7 +3502,7 @@ func TestQueryStatsUpstreamTestCases(t *testing.T) {
35013502 runQueryAndGetSamplesStats := func (t * testing.T , engine promql.QueryEngine , expr string , start , end time.Time , interval time.Duration ) * promstats.QuerySamples {
35023503 var q promql.Query
35033504 var err error
3504- opts := promql .NewPrometheusQueryOpts (true , 0 )
3505+ opts := promql .NewPrometheusQueryOpts (true , 0 , validation . LegacyNamingScheme )
35053506
35063507 if interval == 0 {
35073508 // Instant query
@@ -3882,7 +3883,7 @@ func TestQueryStatementLookbackDelta(t *testing.T) {
38823883 require .NoError (t , err )
38833884
38843885 t .Run ("lookback delta not set in query options" , func (t * testing.T ) {
3885- queryOpts := promql .NewPrometheusQueryOpts (false , 0 )
3886+ queryOpts := promql .NewPrometheusQueryOpts (false , 0 , validation . LegacyNamingScheme )
38863887 runTest (t , engine , queryOpts , defaultLookbackDelta )
38873888 })
38883889
@@ -3891,7 +3892,7 @@ func TestQueryStatementLookbackDelta(t *testing.T) {
38913892 })
38923893
38933894 t .Run ("lookback delta set in query options" , func (t * testing.T ) {
3894- queryOpts := promql .NewPrometheusQueryOpts (false , 14 * time .Minute )
3895+ queryOpts := promql .NewPrometheusQueryOpts (false , 14 * time .Minute , validation . LegacyNamingScheme )
38953896 runTest (t , engine , queryOpts , 14 * time .Minute )
38963897 })
38973898 })
@@ -3903,7 +3904,7 @@ func TestQueryStatementLookbackDelta(t *testing.T) {
39033904 require .NoError (t , err )
39043905
39053906 t .Run ("lookback delta not set in query options" , func (t * testing.T ) {
3906- queryOpts := promql .NewPrometheusQueryOpts (false , 0 )
3907+ queryOpts := promql .NewPrometheusQueryOpts (false , 0 , validation . LegacyNamingScheme )
39073908 runTest (t , engine , queryOpts , 12 * time .Minute )
39083909 })
39093910
@@ -3912,7 +3913,7 @@ func TestQueryStatementLookbackDelta(t *testing.T) {
39123913 })
39133914
39143915 t .Run ("lookback delta set in query options" , func (t * testing.T ) {
3915- queryOpts := promql .NewPrometheusQueryOpts (false , 14 * time .Minute )
3916+ queryOpts := promql .NewPrometheusQueryOpts (false , 14 * time .Minute , validation . LegacyNamingScheme )
39163917 runTest (t , engine , queryOpts , 14 * time .Minute )
39173918 })
39183919 })
0 commit comments