test(promql): compile the Prometheus golden differential again

`map/tests.rs` never declared `mod prometheus`, so `map/prometheus_cases.txt` and
`map/tests/prometheus.rs` sat in the tree without being compiled: the golden cases
evaluated by the real Prometheus engine, and the harness that runs them, were dead
files. Nothing would have caught a drift from Prometheus in `map_math`.

Declare the module again and adapt the harness to the `Option` return, dropping a
series the kernel reports as having no float value. The harness asserts at least 48
math cases, so a future change that silently disables the fixture fails instead of
passing with zero cases.

Signed-off-by: discord9 <discord9@users.noreply.github.com>
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
This commit is contained in:
discord9
2026-10-19 15:42:35 +08:00
parent 4644a738d2
commit 27ecf8ebea
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -32,6 +32,8 @@ use datatypes::series::{Label, MetricName};
use super::*;
use crate::functions::IeeeSqrt;
mod prometheus;
fn schema(names: &[&str]) -> SeriesSchema {
SeriesSchema {
fields: names
+1 -1
View File
@@ -225,7 +225,7 @@ fn math_matches_prometheus() {
let output = case
.series
.iter()
.map(|series| map_math(&case.schema, series, op).unwrap())
.filter_map(|series| map_math(&case.schema, series, op).unwrap())
.collect();
assert_result(case, output);
matched += 1;