mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-11-28 13:44:03 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user