Skip to content

Commit

Permalink
Update upstream test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskorn committed Mar 6, 2025
1 parent e0964c4 commit f8d4d07
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion pkg/streamingpromql/testdata/upstream/functions.test
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ clear

# Tests for vector, time and timestamp.
load 10s
metric 1 1
metric 1 1 {{schema:0 sum:1 count:1}}

eval instant at 0s timestamp(metric)
{} 0
Expand All @@ -441,6 +441,9 @@ eval instant at 10s timestamp(metric)
eval instant at 10s timestamp(((metric)))
{} 10

eval instant at 20s timestamp(metric)
{} 20

# Tests for label_join.
load 5m
testmetric{src="a",src1="b",src2="c",dst="original-destination-value"} 0
Expand Down Expand Up @@ -830,6 +833,8 @@ load 10s
metric9 -9.988465674311579e+307 -9.988465674311579e+307 -9.988465674311579e+307
metric10 -9.988465674311579e+307 9.988465674311579e+307
metric11 1 2 3 NaN NaN
metric12 1 2 3 {{schema:0 sum:1 count:1}} {{schema:0 sum:3 count:3}}
metric13 {{schema:0 sum:1 count:1}}x5

eval instant at 55s avg_over_time(metric[1m])
{} 3
Expand Down Expand Up @@ -936,6 +941,23 @@ eval instant at 1m avg_over_time(metric11[1m])
eval instant at 1m sum_over_time(metric11[1m])/count_over_time(metric11[1m])
{} NaN

# Tests for samples with mix of floats and histograms.
eval_warn instant at 1m sum_over_time(metric12[1m])
# no result.

eval_warn instant at 1m avg_over_time(metric12[1m])
# no result.

# Tests for samples with only histograms.
eval instant at 1m sum_over_time(metric13[1m])
{} {{schema:0 sum:5 count:5}}

eval instant at 1m avg_over_time(metric13[1m])
{} {{schema:0 sum:1 count:1}}

eval instant at 1m sum_over_time(metric13[1m])/count_over_time(metric13[1m])
{} {{schema:0 sum:1 count:1}}

# Test if very big intermediate values cause loss of detail.
clear
load 10s
Expand Down

0 comments on commit f8d4d07

Please sign in to comment.