fix #2583: fix negative and asymmetric edge costs in stoer wagner tests#3104
fix #2583: fix negative and asymmetric edge costs in stoer wagner tests#3104prashsti29 wants to merge 2 commits intopgRouting:developfrom
Conversation
WalkthroughUpdates Stoer–Wagner test scripts to normalize Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pgtap/mincut/stoerWagner/edge_cases.pg (1)
17-22: 🧹 Nitpick | 🔵 TrivialPre-existing SQL syntax issue in the test query.
The inner query has a missing
WHEREkeyword:FROM edges id < 17should beFROM edges WHERE id < 17. While this test passes because it expects the function signature error (function with 2 args doesn't exist), the SQL error would occur first if the function signature matched.This is a pre-existing issue unrelated to this PR's changes.
Suggested fix for the SQL syntax
SELECT throws_ok( 'SELECT * FROM pgr_stoerWagner( - ''SELECT id, source, target, cost, reverse_cost FROM edges id < 17'', + ''SELECT id, source, target, cost, reverse_cost FROM edges WHERE id < 17'', 3 )','42883','function pgr_stoerwagner(unknown, integer) does not exist', '6: Documentation says it does not work with 1 flags');🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pgtap/mincut/stoerWagner/edge_cases.pg` around lines 17 - 22, The test contains a SQL syntax error in the inner query of the SELECT throws_ok call: replace the malformed fragment "FROM edges id < 17" with a proper WHERE clause so the inner query is "SELECT id, source, target, cost, reverse_cost FROM edges WHERE id < 17"; update the test that invokes pgr_stoerWagner (the SELECT throws_ok wrapping pgr_stoerWagner call) to use the corrected inner SQL so the intended function-signature error remains the first possible error when appropriate.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@pgtap/mincut/stoerWagner/edge_cases.pg`:
- Around line 17-22: The test contains a SQL syntax error in the inner query of
the SELECT throws_ok call: replace the malformed fragment "FROM edges id < 17"
with a proper WHERE clause so the inner query is "SELECT id, source, target,
cost, reverse_cost FROM edges WHERE id < 17"; update the test that invokes
pgr_stoerWagner (the SELECT throws_ok wrapping pgr_stoerWagner call) to use the
corrected inner SQL so the intended function-signature error remains the first
possible error when appropriate.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: d2ee35b1-a4d2-4422-a2cb-3f2a4e98ec3d
📒 Files selected for processing (4)
pgtap/mincut/stoerWagner/compare_components.pgpgtap/mincut/stoerWagner/edge_cases.pgpgtap/mincut/stoerWagner/inner_query.pgpgtap/mincut/stoerWagner/types_check.pg
Fixes #2583
Changes proposed in this pull request:
@pgRouting/admins
Summary by CodeRabbit