Skip to content

Enable tests to run in parallel by default#3895

Draft
ExtReMLapin wants to merge 45 commits intoArcadeData:mainfrom
ExtReMLapin:more_test_fast_tests
Draft

Enable tests to run in parallel by default#3895
ExtReMLapin wants to merge 45 commits intoArcadeData:mainfrom
ExtReMLapin:more_test_fast_tests

Conversation

@ExtReMLapin
Copy link
Copy Markdown
Contributor

To be merged after #3428

Pierre F and others added 30 commits February 15, 2026 09:07
…penCypherAggregatingFunctionsComprehensiveTest.java

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…penCypherAggregatingFunctionsComprehensiveTest.java

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly expands OpenCypher function support, adding geospatial, temporal, vector, and string functions along with GQL-conformant aliases. It also improves test parallelization by updating the TestHelper and implementing resource locks across the test suite. Feedback focuses on fixing a potential NumberFormatException for empty vector strings, ensuring split() preserves trailing empty strings per Cypher specifications, restoring robustness in point() coordinate parsing, and handling potential nulls or incorrect types in map-based distance calculations.

Comment on lines +95 to +97
final String inner = trimmed.startsWith("[") && trimmed.endsWith("]") ? trimmed.substring(1, trimmed.length() - 1) : trimmed;
final String[] parts = inner.split(",");
final float[] result = new float[parts.length];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The current parsing logic will throw a NumberFormatException if the input string represents an empty array []. When inner is an empty string, split(",") returns an array containing one empty string, which Float.parseFloat() cannot handle. Additionally, it doesn't handle cases with extra commas or whitespace between values gracefully.

Suggested change
final String inner = trimmed.startsWith("[") && trimmed.endsWith("]") ? trimmed.substring(1, trimmed.length() - 1) : trimmed;
final String[] parts = inner.split(",");
final float[] result = new float[parts.length];
final String inner = trimmed.startsWith("[") && trimmed.endsWith("]") ? trimmed.substring(1, trimmed.length() - 1).trim() : trimmed;
if (inner.isEmpty())
return new float[0];
final String[] parts = inner.split(",");
final float[] result = new float[parts.length];

return null;
final String str = args[0].toString();
final String delimiter = args[1].toString();
return List.of(str.split(Pattern.quote(delimiter)));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Java's String.split(regex) discards trailing empty strings by default. To comply with the Cypher specification, which expects trailing empty strings to be preserved (e.g., split('a,b,', ',') should return ['a', 'b', '']), you should use the two-argument version of split with a negative limit.

Suggested change
return List.of(str.split(Pattern.quote(delimiter)));
return List.of(str.split(Pattern.quote(delimiter), -1));

Comment on lines +58 to +59
final double lat = ((Number) args[0]).doubleValue();
final double lon = ((Number) args[1]).doubleValue();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This change reduces robustness compared to the previous implementation. The previous code used GeoUtils.getDoubleValue(), which safely handles both Number and String inputs. The direct cast to Number will throw a ClassCastException if the input is a string representation of a coordinate.

Suggested change
final double lat = ((Number) args[0]).doubleValue();
final double lon = ((Number) args[1]).doubleValue();
final double lat = com.arcadedb.function.sql.geo.GeoUtils.getDoubleValue(args[0]);
final double lon = com.arcadedb.function.sql.geo.GeoUtils.getDoubleValue(args[1]);

Comment on lines +56 to +57
((Number) p1.get("latitude")).doubleValue(), ((Number) p1.get("longitude")).doubleValue(),
((Number) p2.get("latitude")).doubleValue(), ((Number) p2.get("longitude")).doubleValue());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This code is unsafe as it assumes the map values are non-null and of type Number. If a coordinate is null in the map (which is possible in Cypher), this will throw a NullPointerException. If it's a String, it will throw a ClassCastException. It is safer to use GeoUtils.getDoubleValue() after verifying the values are not null.

@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 68 complexity

Metric Results
Complexity 68

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 18, 2026

Codecov Report

❌ Patch coverage is 76.26667% with 89 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.53%. Comparing base (5c288d2) to head (b09a93f).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...com/arcadedb/function/geo/CypherPointFunction.java 74.60% 6 Missing and 10 partials ⚠️
.../query/opencypher/executor/CypherTrimFunction.java 72.50% 5 Missing and 6 partials ⚠️
...rc/main/java/com/arcadedb/GlobalConfiguration.java 0.00% 9 Missing and 1 partial ⚠️
...dedb/function/geo/CypherPointDistanceFunction.java 72.22% 4 Missing and 6 partials ⚠️
...y/opencypher/executor/CypherSubstringFunction.java 66.66% 3 Missing and 3 partials ⚠️
...java/com/arcadedb/function/math/RoundFunction.java 64.28% 2 Missing and 3 partials ⚠️
...n/java/com/arcadedb/function/sql/geo/GeoUtils.java 44.44% 4 Missing and 1 partial ⚠️
.../com/arcadedb/function/text/SubstringFunction.java 0.00% 1 Missing and 2 partials ⚠️
...query/opencypher/executor/CypherSplitFunction.java 66.66% 2 Missing and 1 partial ⚠️
...edb/function/temporal/DateConstructorFunction.java 71.42% 2 Missing ⚠️
... and 9 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3895      +/-   ##
============================================
- Coverage     64.71%   56.53%   -8.19%     
- Complexity        0     1572    +1572     
============================================
  Files          1581     1585       +4     
  Lines        117023   117508     +485     
  Branches      24858    24957      +99     
============================================
- Hits          75730    66431    -9299     
- Misses        30933    41743   +10810     
+ Partials      10360     9334    -1026     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant