Repository navigation
fix(#5942)(#5943): retarget stale exception-type assertions after CommandSemanticException retyping - #5954
Conversation
…mandSemanticException retyping RangeFunction.execute() and CypherPointFunction.coerceCoordinate() were retyped from CommandExecutionException to CommandSemanticException by PR #5909 (#5794) so the HTTP layer answers 400 on these errors. Two pre-existing tests untouched by that PR, RangeFunctionTest.stepZeroIsStillRejected and Issue4305Test.pointRaisesCleanErrorOnNonNumericString, still asserted the old type and were deterministically failing on main.
|
Tick the box to add this pull request to the merge queue (same as
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Coverage variation | Report missing for 49715e21 |
| Diff coverage | ✅ ∅ diff coverage |
Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (49715e2) Report Missing Report Missing Report Missing Head commit (5cc0613) 185484 130702 70.47% Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>
Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#5954) 0 0 ∅ (not applicable) Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
ReviewSmall, well-scoped fix and I verified the core claims directly against
Notes:
No code quality, correctness, performance, or security concerns here - this is test-only and the retyped assertions are the right ones per the actual exception hierarchy. Test coverage is unchanged in scope (existing tests fixed, not added), which is appropriate since the underlying behavior isn't new. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5954 +/- ##
=======================================
Coverage 68.10% 68.10%
=======================================
Files 1797 1797
Lines 153141 153141
Branches 32436 32436
=======================================
+ Hits 104299 104303 +4
+ Misses 35442 35436 -6
- Partials 13400 13402 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Fixes #5942 and #5943 (duplicates of the same root cause) -
main'sunit-testsjob was deterministically red.PR #5909 (fix for #5794) retyped the errors thrown by
RangeFunction.execute()(zero step) andCypherPointFunction.coerceCoordinate()(non-numeric coordinate) fromCommandExecutionExceptiontoCommandSemanticException, deliberately, so the HTTP layer's 400 arm (which keys onCommandParsingException, the parent ofCommandSemanticException) picks them up.That PR added its own new test (
CypherFunctionArgumentValidationIssue5794Test) correctly asserting the new type, but two pre-existing tests exercising the same call sites were not touched by that diff and kept asserting the old type:RangeFunctionTest.stepZeroIsStillRejectedIssue4305Test.pointRaisesCleanErrorOnNonNumericStringBoth failed on every CI run since 456f670 landed, masking any real regression in the
unit-testsjob.Fix
Retarget both assertions to
CommandSemanticException, matching the class's own hierarchy (CommandSemanticException extends CommandParsingException) and whatCypherFunctionArgumentValidationIssue5794Testalready asserts for the same functions. Removed the now-unusedCommandExecutionExceptionimport from both files and updated the one Javadoc reference inIssue4305Testthat named the old type.No production code changed - the thrown-exception behavior introduced by #5909 was correct; only the two stale assertions were wrong.
Out of scope
Issue #5942 also flagged
PostgresWJdbcIT.parsingErrorMgmtas "possibly the same root cause, not verified." I checked it: it asserts aPSQLExceptionon a malformed\u30unicode escape in a SQL literal, unrelated to therange()/point()retyping. It's being tracked separately.Test plan
mvn -o -pl engine test -Dtest='RangeFunctionTest,Issue4305Test'- 19/19 pass (previously 2 failures)mvn -o -pl engine test -Dtest='CypherFunctionArgumentValidationIssue5794Test'- 6/6 pass, confirms no regression on the sibling test added by fix(#5794): range() zero step, invalid date()/datetime(), non-numeric point() coordinates return HTTP 400 #5909mvn -o -pl engine -am test-compile- compiles clean