()
| 634 | |
| 635 | #[test] |
| 636 | fn test_dml_performance() { |
| 637 | let fixture = TestFixture::new().expect("Failed to create test fixture"); |
| 638 | // Setup fresh graph for this test to avoid interference |
| 639 | fixture |
| 640 | .setup_graph("test_dml_performance") |
| 641 | .expect("Failed to setup graph"); |
| 642 | |
| 643 | // Test bulk insert performance |
| 644 | let start = std::time::Instant::now(); |
| 645 | |
| 646 | // Insert 100 nodes in smaller batches to avoid lexer infinite loop |
| 647 | for batch in 0..10 { |
| 648 | let mut insert_query = String::from("INSERT "); |
| 649 | let mut clauses = Vec::new(); |
| 650 | |
| 651 | for i in 0..10 { |
| 652 | let node_id = batch * 10 + i; |
| 653 | clauses.push(format!( |
| 654 | "(perf_node_{}:PerfNode {{id: {}, batch: {}, value: {}}})", |
| 655 | node_id, |
| 656 | node_id, |
| 657 | batch, |
| 658 | node_id * 2 |
| 659 | )); |
| 660 | } |
| 661 | |
| 662 | insert_query.push_str(&clauses.join(", ")); |
| 663 | fixture.assert_query_succeeds(&insert_query); |
| 664 | |
| 665 | // Debug: check node count after each batch |
| 666 | let result = fixture |
| 667 | .query("MATCH (p:PerfNode) RETURN count(p) as count") |
| 668 | .unwrap(); |
| 669 | if !result.rows.is_empty() { |
| 670 | let _count = result.rows[0] |
| 671 | .values |
| 672 | .get("count") |
| 673 | .unwrap_or(&Value::Number(0.0)); |
| 674 | } |
| 675 | } |
| 676 | |
| 677 | let insert_duration = start.elapsed(); |
| 678 | |
| 679 | // Verify all nodes inserted |
| 680 | let result = fixture |
| 681 | .query("MATCH (p:PerfNode) RETURN count(p) as count") |
| 682 | .unwrap(); |
| 683 | if result.rows.is_empty() { |
| 684 | panic!("Expected to find nodes, but count query returned no rows"); |
| 685 | } else { |
| 686 | let count = result.rows[0].values.get("count").unwrap(); |
| 687 | assert_eq!( |
| 688 | count, |
| 689 | &Value::Number(100.0), |
| 690 | "Expected 100 nodes to be inserted" |
| 691 | ); |
| 692 | } |
| 693 |
nothing calls this directly
no test coverage detected