prometheus icon indicating copy to clipboard operation
prometheus copied to clipboard

Convert PromQL test files to new syntax using strict migration mode

Open kapillamba4 opened this issue 7 months ago • 1 comments

Continuation of https://github.com/prometheus/prometheus/pull/16562/

kapillamba4 avatar May 08 '25 15:05 kapillamba4

FTR: We'll have a detailed look here once #16562 is merged.

beorn7 avatar May 29 '25 21:05 beorn7

Now this needs a rebase.

As hinted at before, I think the strict mode is in most cases too strict. Many tests don't care if there is an annotation or not. They are testing something else.

Now that eval is more tolerant, we should actually make use of it.

I think a better strategy is to do the conversion with the basic mode (in one commit) and then (in a separate commit) make those tests stricter where we are actively interested in testing the presence or absence of certain annotations.

beorn7 avatar Jun 18 '25 22:06 beorn7

First commit contains changes via the script using basic mode. The second commit introduces minor adjustments to the test files:

  • Decided to retain expect info & expect warn statements for tests involving mixed histograms and floats.
  • Explicitly added expect no_info & expect no_warn in tests producing no results.
  • Removed expect info from a test case where the metric name does not end with _total, as the test seems to focus on comparing value and not presence of annotation.
  • No changes to tests having expect fail or expect warn

The changes in the second commit were minimal, based on my understanding @beorn7 please review it when you have time, thanks !

cc @NeerajGartia21

kapillamba4 avatar Jun 21 '25 13:06 kapillamba4

Apologies for the delay here—got caught up with work and personal life. I've addressed the comments now, please take a look. Thanks for your patience!

kapillamba4 avatar Jul 09 '25 01:07 kapillamba4