-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: fix TinkerPop unit test #2055
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2055 +/- ##
============================================
+ Coverage 64.98% 68.35% +3.37%
- Complexity 976 979 +3
============================================
Files 481 481
Lines 39749 39807 +58
Branches 5582 5592 +10
============================================
+ Hits 25829 27212 +1383
+ Misses 11374 9954 -1420
- Partials 2546 2641 +95
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
f530722
to
2753e68
Compare
test fine in |
hugegraph-core/src/main/java/org/apache/hugegraph/StandardHugeGraph.java
Outdated
Show resolved
Hide resolved
hugegraph-core/src/main/java/org/apache/hugegraph/backend/query/ConditionQueryFlatten.java
Outdated
Show resolved
Hide resolved
return (HugeGraph) graph.get(); | ||
} | ||
|
||
public static void trySetGraph(Step<?, ?> step, HugeGraph graph) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems don't need to set graph anymore, please refer to apache/tinkerpop#1699
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I have add TODO
// TODO: remove these EmptyGraph judgments when upgrading tinkerpop to a fixed version
@@ -51,6 +51,22 @@ public static List<ConditionQuery> flatten(ConditionQuery query) { | |||
public static List<ConditionQuery> flatten(ConditionQuery query, | |||
boolean supportIn) { | |||
if (query.isFlattened() && !query.mayHasDupKeys(SPECIAL_KEYS)) { | |||
Relations relations = new Relations(); | |||
List<Condition> noRelations = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to conditions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are two type, the one is relation, and other, so maybe relation name is more suitable.
hugegraph-core/src/main/java/org/apache/hugegraph/traversal/optimize/TraversalUtil.java
Outdated
Show resolved
Hide resolved
hugegraph-core/src/main/java/org/apache/hugegraph/traversal/optimize/TraversalUtil.java
Outdated
Show resolved
Hide resolved
hugegraph-core/src/main/java/org/apache/hugegraph/backend/query/ConditionQueryFlatten.java
Outdated
Show resolved
Hide resolved
hugegraph-core/src/main/java/org/apache/hugegraph/backend/query/ConditionQueryFlatten.java
Outdated
Show resolved
Hide resolved
hugegraph-core/src/main/java/org/apache/hugegraph/StandardHugeGraph.java
Outdated
Show resolved
Hide resolved
d9ede1e
to
805ae2a
Compare
e72ad2f
to
5206283
Compare
hugegraph-core/src/main/java/org/apache/hugegraph/backend/query/ConditionQueryFlatten.java
Outdated
Show resolved
Hide resolved
hugegraph-core/src/main/java/org/apache/hugegraph/traversal/optimize/HugeGraphStep.java
Outdated
Show resolved
Hide resolved
@@ -104,6 +104,7 @@ public void apply(Traversal.Admin<?, ?> traversal) { | |||
graphStep.queryInfo().aggregate(Aggregate.AggregateFunc.COUNT, null); | |||
HugeCountStep<?> countStep = new HugeCountStep<>(traversal, graphStep); | |||
for (Step<?, ?> origin : originSteps) { | |||
TraversalHelper.copyLabels(origin, countStep, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a replaceStep method that contains a copyLabels call? otherwise add some comments for why?
hugegraph-core/src/main/java/org/apache/hugegraph/StandardHugeGraph.java
Outdated
Show resolved
Hide resolved
hugegraph-core/src/main/java/org/apache/hugegraph/traversal/optimize/TraversalUtil.java
Outdated
Show resolved
Hide resolved
boolean supportsPersistence = this.backendStoreFeatures().supportsPersistence(); | ||
this.features = new HugeFeatures(this, supportsPersistence); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems the ci fails due to this.backendStoreFeatures() call, try to move to line 222?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here are backendStoreFeatures() call tx.readwrite cause ConnectionException, but Open method catch the exception, throw RuntimeException, so here need change the unit test
g1.initBackend(); | ||
g1.clearBackend(); | ||
|
||
final HugeGraph[] g2 = new HugeGraph[1]; | ||
Assert.assertThrows(ConnectionException.class, () -> { | ||
Assert.assertThrows(RuntimeException.class, () -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we keep the ConnectionException and update the throw-exception location?
fix #2058