#[cfg(not(feature = "testmatrix"))]
#[test]
fn functional_status_is_a_linked_noop() {
graphar_flight::functional_status(
"graphar-flight/get_flight_info_statement",
"schema_resolved",
true,
"MATCH (n) RETURN n",
);
graphar_flight::functional_status(
"graphar-flight/do_get_statement",
"cypher_stream",
false,
"bad cypher",
);
}
#[cfg(feature = "testmatrix")]
#[test]
fn wrapper_forwards_flight_sql_surface_outcomes() {
use nornir_testmatrix::{drain_functional_rows, status};
let _ = drain_functional_rows();
graphar_flight::functional_status(
"graphar-flight/get_flight_info_statement",
"schema_resolved",
true,
"MATCH (n) RETURN n",
);
graphar_flight::functional_status(
"graphar-flight/do_get_statement",
"cypher_stream",
false,
"MATCH (bad",
);
let rows = drain_functional_rows();
let info = rows
.iter()
.find(|r| {
r.suite == "graphar-flight/get_flight_info_statement"
&& r.test_name == "schema_resolved"
})
.unwrap_or_else(|| panic!("get_flight_info surface must record; got {rows:?}"));
assert!(status::is_green(&info.status), "resolved schema is GREEN: {info:?}");
assert_eq!(info.aspect, "functional");
assert_eq!(info.metric, 0.0);
assert_eq!(info.message, "MATCH (n) RETURN n", "detail carries the cypher");
let get = rows
.iter()
.find(|r| r.suite == "graphar-flight/do_get_statement" && r.test_name == "cypher_stream")
.unwrap_or_else(|| panic!("do_get surface must record; got {rows:?}"));
assert!(status::is_red(&get.status), "a failed stream is RED: {get:?}");
assert_eq!(get.metric, 1.0, "red rows carry metric 1.0");
assert_eq!(get.message, "MATCH (bad", "detail carries the failing cypher");
}