Skip to content
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

Merged
merged 14 commits into from
Dec 26, 2022
Merged

chore: fix TinkerPop unit test #2055

merged 14 commits into from
Dec 26, 2022

Conversation

zyxxoo
Copy link
Contributor

@zyxxoo zyxxoo commented Dec 18, 2022

fix #2058

@codecov
Copy link

codecov bot commented Dec 18, 2022

Codecov Report

Merging #2055 (225854c) into master (fc27f2c) will increase coverage by 3.37%.
The diff coverage is 39.74%.

@@             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     
Impacted Files Coverage Δ
...he/hugegraph/traversal/optimize/TraversalUtil.java 59.41% <26.08%> (-3.27%) ⬇️
...he/hugegraph/traversal/optimize/HugeGraphStep.java 73.56% <33.33%> (-2.02%) ⬇️
...hugegraph/backend/query/ConditionQueryFlatten.java 75.39% <50.00%> (-0.34%) ⬇️
...n/java/org/apache/hugegraph/StandardHugeGraph.java 68.36% <100.00%> (+2.77%) ⬆️
...a/org/apache/hugegraph/structure/HugeFeatures.java 32.94% <100.00%> (+1.61%) ⬆️
...raph/traversal/optimize/HugeCountStepStrategy.java 81.81% <100.00%> (+0.56%) ⬆️
...raph/traversal/optimize/HugeGraphStepStrategy.java 100.00% <100.00%> (ø)
...rc/main/java/org/apache/hugegraph/HugeFactory.java 63.49% <0.00%> (-6.35%) ⬇️
...gegraph/election/RoleElectionStateMachineImpl.java 68.54% <0.00%> (-2.42%) ⬇️
...a/org/apache/hugegraph/util/collection/IntSet.java 73.72% <0.00%> (-1.28%) ⬇️
... and 57 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@zyxxoo zyxxoo force-pushed the zy_dev branch 3 times, most recently from f530722 to 2753e68 Compare December 18, 2022 19:30
@zyxxoo zyxxoo changed the title chore: fix thinkpop unit test chore: fix tinkerpop unit test Dec 18, 2022
@zyxxoo zyxxoo changed the title chore: fix tinkerpop unit test chore: fix tinkerPop unit test Dec 18, 2022
@imbajin
Copy link
Member

imbajin commented Dec 19, 2022

test fine in release branch first, mark this as draft & enable it later

@imbajin imbajin marked this pull request as draft December 19, 2022 05:49
return (HugeGraph) graph.get();
}

public static void trySetGraph(Step<?, ?> step, HugeGraph graph) {
Copy link
Contributor

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

Copy link
Contributor Author

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<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

rename to conditions?

Copy link
Contributor Author

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.

@imbajin imbajin marked this pull request as ready for review December 21, 2022 08:23
@zyxxoo zyxxoo mentioned this pull request Dec 22, 2022
1 task
@zyxxoo zyxxoo force-pushed the zy_dev branch 2 times, most recently from d9ede1e to 805ae2a Compare December 22, 2022 11:50
@zyxxoo zyxxoo changed the title chore: fix tinkerPop unit test chore: fix tinkerPop unit test schema no define Dec 22, 2022
@zyxxoo zyxxoo changed the title chore: fix tinkerPop unit test schema no define chore: fix tinkerPop unit test Dec 22, 2022
@zyxxoo zyxxoo force-pushed the zy_dev branch 2 times, most recently from e72ad2f to 5206283 Compare December 22, 2022 12:00
@@ -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);
Copy link
Contributor

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?

@javeme javeme changed the title chore: fix tinkerPop unit test chore: fix TinkerPop unit test Dec 22, 2022
Comment on lines +215 to +216
boolean supportsPersistence = this.backendStoreFeatures().supportsPersistence();
this.features = new HugeFeatures(this, supportsPersistence);
Copy link
Contributor

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?

Copy link
Contributor Author

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

@zyxxoo zyxxoo changed the base branch from master to release-1.0.0 December 23, 2022 02:15
@zyxxoo zyxxoo changed the base branch from release-1.0.0 to master December 26, 2022 05:49
@zyxxoo zyxxoo requested review from javeme and imbajin December 26, 2022 07:29
g1.initBackend();
g1.clearBackend();

final HugeGraph[] g2 = new HugeGraph[1];
Assert.assertThrows(ConnectionException.class, () -> {
Assert.assertThrows(RuntimeException.class, () -> {
Copy link
Contributor

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?

@javeme javeme merged commit 6c3170c into master Dec 26, 2022
@javeme javeme deleted the zy_dev branch December 26, 2022 14:41
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.

[Bug] TinkerPop unit test bug
4 participants