promqltest: add/remove explicit annotation expectations to relevant tests

Signed-off-by: Kapil Lamba <kapillamba4@gmail.com>
This commit is contained in:
Kapil Lamba 2025-06-21 18:40:57 +05:30
parent 658e9c5155
commit 030835560b
5 changed files with 17 additions and 4 deletions

View File

@ -90,9 +90,7 @@ eval instant at 25s sum_over_time(metric{job="1"}[100] offset 50s @ 100)
eval instant at 25s metric{job="1"} @ 50 + metric{job="1"} @ 100
{job="1"} 15
# Note that this triggers an info annotation because we are rate'ing a metric that does not end in `_total`.
eval instant at 25s rate(metric{job="1"}[100s] @ 100) + label_replace(rate(metric{job="2"}[123s] @ 200), "job", "1", "", "")
expect info
{job="1"} 0.3
eval instant at 25s sum_over_time(metric{job="1"}[100s] @ 100) + label_replace(sum_over_time(metric{job="2"}[100s] @ 100), "job", "1", "", "")

View File

@ -370,7 +370,10 @@ eval instant at 100m deriv(testcounter_reset_middle_mix[110m])
{} 0.010606060606060607
# deriv should silently ignore ranges consisting only of histograms.
# expects both an empty result and no info/warn annotations.
eval instant at 50m deriv(http_requests_histogram[60m])
expect no_info
expect no_warn
#empty
# deriv should return NaN in case of +Inf or -Inf found.
@ -423,6 +426,8 @@ eval instant at 60m predict_linear(testcounter_reset_middle_mix[60m], 50m)
# predict_linear should silently ignore ranges consisting only of histograms.
eval instant at 60m predict_linear(http_requests_histogram[60m], 50m)
expect no_info
expect no_warn
#empty
# predict_linear should return NaN in case of +Inf or -Inf found.

View File

@ -15,9 +15,13 @@ load 5m
bar 0 1 0 -1 0 1 0 -1 0 1 0
eval instant at 50m count(limitk by (group) (0, http_requests))
expect no_info
expect no_warn
# empty
eval instant at 50m count(limitk by (group) (-1, http_requests))
expect no_info
expect no_warn
# empty
# Exercise k==1 special case (as sample is added before the main series loop).

View File

@ -533,6 +533,8 @@ eval range from 0 to 60m step 6m left_floats == bool right_floats
{} 0 _ _ _ 1 _ 0 0 0 1 1
eval range from 0 to 60m step 6m left_floats == does_not_match
expect no_info
expect no_info
# No results.
eval range from 0 to 24m step 6m left_histograms == right_histograms
@ -816,6 +818,8 @@ eval range from 0 to 60m step 6m Inf == bool left_floats
{} 0 0 _ _ 0 _ 0 0 0 1 0
eval range from 0 to 60m step 6m NaN == left_floats
expect no_info
expect no_warn
# No results.
eval range from 0 to 60m step 6m NaN == bool left_floats

View File

@ -156,4 +156,6 @@ load 5m
foo 3+0x10
eval instant at 12m min_over_time((topk(1, foo))[1m:5m])
expect no_info
expect no_warn
#empty