mirror of
https://github.com/Canner/WrenAI.git
synced 2026-10-16 06:57:43 +08:00
test(context-loader): cover a seed that is an edge source but not a node
The differential suite compared declared nodes and ids absent from the graph entirely, which conflates two different things: an id with no node and no edges, and an id with no node but with outgoing edges. Only the second makes it observable whether the traversal short-circuits on an undeclared seed. It matters because short-circuiting there looks like an obvious improvement — the documented behaviour for an unknown seed is an empty result — but the framework's traversal follows the edges instead, so the two would silently stop agreeing. Without this case the whole suite stays green while that happens.
This commit is contained in:
@@ -268,6 +268,19 @@ fn a_cyclic_graph_terminates_and_still_agrees() {
|
||||
);
|
||||
}
|
||||
|
||||
/// A seed that is an edge *source* but not a declared node. Distinct from a dangling endpoint:
|
||||
/// here the undeclared id has outgoing edges, so "unknown seed" and "leaf seed" come apart, and
|
||||
/// whether the traversal short-circuits on an undeclared seed becomes observable.
|
||||
#[test]
|
||||
fn a_dangling_edge_source_agrees_too() {
|
||||
let graph = LineageGraph {
|
||||
nodes: vec![node("dashboard:sales", LineageKind::Dashboard)],
|
||||
edges: vec![edge("model:missing", "dashboard:sales")],
|
||||
};
|
||||
assert_agrees_on(&graph, "model:missing");
|
||||
assert_agrees_everywhere(&graph);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_dangling_edge_endpoint_carries_no_severity() {
|
||||
// `is_resolvable` is what reports a dangling reference; the impact analysis must not invent a
|
||||
|
||||
Reference in New Issue
Block a user