Loading crates/integration-testkit/src/visitor/mod.rs +5 −3 Original line number Diff line number Diff line Loading @@ -326,18 +326,20 @@ impl ResponseView { .collect() } /// Return the set of distinct path_ids present in edges. /// Return the distinct path_ids present in edges, in first-seen order. /// /// Tests should use this to discover which paths exist, then call /// [`path`] for each one explicitly. /// Satisfies [`Requirement::PathFinding`]. pub fn path_ids(&self) -> MustInspect<HashSet<usize>> { pub fn path_ids(&self) -> MustInspect<Vec<usize>> { self.tracker.satisfy(Requirement::PathFinding); let mut seen = HashSet::new(); let ids = self .response .edges .iter() .filter_map(|e| e.path_id) .filter(|id| seen.insert(*id)) .collect(); MustInspect::new(ids, "path_ids()") } Loading Loading @@ -993,7 +995,7 @@ pub(crate) mod tests { pagination: None, }; let view = ResponseView::new(resp); assert_eq!(view.path_ids(), HashSet::from([0, 2])); assert_eq!(*view.path_ids(), vec![0, 2]); } #[test] Loading crates/integration-tests/tests/server/data_correctness/pagination.rs +2 −8 Original line number Diff line number Diff line Loading @@ -560,8 +560,8 @@ pub(super) async fn cursor_path_finding_pages_cover_all_paths(ctx: &TestContext) } pub(super) async fn cursor_path_finding_is_deterministic(ctx: &TestContext) { // Run the same cursored path finding query twice. The ORDER BY // (depth, _gkg_path, _gkg_edge_kinds) should produce identical results. // Run the same cursored path finding query twice and verify both runs // return the same set of destination nodes. let query = r#"{ "query_type": "path_finding", "nodes": [ Loading @@ -581,13 +581,7 @@ pub(super) async fn cursor_path_finding_is_deterministic(ctx: &TestContext) { let pids1 = resp1.path_ids(); let pids2 = resp2.path_ids(); assert_eq!( pids1.len(), pids2.len(), "same query should return same path count" ); // Compare the destination nodes of each path to verify identical ordering. let dests1: Vec<i64> = pids1 .iter() .map(|&pid| resp1.path(pid).last().unwrap().to_id) Loading Loading
crates/integration-testkit/src/visitor/mod.rs +5 −3 Original line number Diff line number Diff line Loading @@ -326,18 +326,20 @@ impl ResponseView { .collect() } /// Return the set of distinct path_ids present in edges. /// Return the distinct path_ids present in edges, in first-seen order. /// /// Tests should use this to discover which paths exist, then call /// [`path`] for each one explicitly. /// Satisfies [`Requirement::PathFinding`]. pub fn path_ids(&self) -> MustInspect<HashSet<usize>> { pub fn path_ids(&self) -> MustInspect<Vec<usize>> { self.tracker.satisfy(Requirement::PathFinding); let mut seen = HashSet::new(); let ids = self .response .edges .iter() .filter_map(|e| e.path_id) .filter(|id| seen.insert(*id)) .collect(); MustInspect::new(ids, "path_ids()") } Loading Loading @@ -993,7 +995,7 @@ pub(crate) mod tests { pagination: None, }; let view = ResponseView::new(resp); assert_eq!(view.path_ids(), HashSet::from([0, 2])); assert_eq!(*view.path_ids(), vec![0, 2]); } #[test] Loading
crates/integration-tests/tests/server/data_correctness/pagination.rs +2 −8 Original line number Diff line number Diff line Loading @@ -560,8 +560,8 @@ pub(super) async fn cursor_path_finding_pages_cover_all_paths(ctx: &TestContext) } pub(super) async fn cursor_path_finding_is_deterministic(ctx: &TestContext) { // Run the same cursored path finding query twice. The ORDER BY // (depth, _gkg_path, _gkg_edge_kinds) should produce identical results. // Run the same cursored path finding query twice and verify both runs // return the same set of destination nodes. let query = r#"{ "query_type": "path_finding", "nodes": [ Loading @@ -581,13 +581,7 @@ pub(super) async fn cursor_path_finding_is_deterministic(ctx: &TestContext) { let pids1 = resp1.path_ids(); let pids2 = resp2.path_ids(); assert_eq!( pids1.len(), pids2.len(), "same query should return same path count" ); // Compare the destination nodes of each path to verify identical ordering. let dests1: Vec<i64> = pids1 .iter() .map(|&pid| resp1.path(pid).last().unwrap().to_id) Loading