pieter martin created TINKERPOP-2816:
----------------------------------------
Summary: Gherkin test issues for implementers
Key: TINKERPOP-2816
URL: https://issues.apache.org/jira/browse/TINKERPOP-2816
Project: TinkerPop
Issue Type: Bug
Components: test-suite
Affects Versions: 3.6.1
Reporter: pieter martin
Sqlg is encountering some issues when running the Gherkin feature tests.
* {{g_V_repeatXout_repeatXoutX_timesX1XX_timesX1X_limitX1X_path_by_name}}
{code:java}
Scenario: g_V_repeatXout_repeatXoutX_timesX1XX_timesX1X_limitX1X_path_by_name
Given the modern graph
And the traversal of
"""
g.V().repeat(__.out().repeat(__.out()).times(1)).times(1).limit(1).path().by("name")
"""
When iterated next
Then the result should be unordered
| result |
| marko |
| josh |
| ripple |
{code}
This test assumes an implicit order in the traversal. To fix the test we need
to add in an {{order().by("name")}}
{code:java}
Scenario: g_V_repeatXout_repeatXoutX_timesX1XX_timesX1X_limitX1X_path_by_name
Given the modern graph
And the traversal of
"""
g.V().repeat(__.out().repeat(__.out().order().by("name",
Order.desc)).times(1)).times(1).limit(1).path().by("name")
"""
When iterated next
Then the result should be unordered
| result |
| marko |
| josh |
| ripple |
{code}
* {{g_V_both_both_dedup_byXoutE_countX_name}}
{code:java}
Scenario: g_V_both_both_dedup_byXoutE_countX_name
Given the modern graph
And the traversal of
"""
g.V().both().both().dedup().by(__.outE().count()).values("name")
"""
When iterated to list
Then the result should be unordered
| result |
| marko |
| josh |
| peter |
| ripple |
{code}
This test assumes the order of {{V().both().both()}}.
Unfortunately putting in an {{order().by("name")}} does not help. This is
because of a second bug where {{TinkerPop}} is rewriting the steps incorrectly.
{code:java}
final TinkerGraph g = TinkerFactory.createModern();
GraphTraversal<Vertex, String> traversal =
g.traversal().V().both().both().order().by("name",
Order.asc).dedup().by(__.outE().count()).<String>values("name");
while (traversal.hasNext()) {
System.out.println(((DefaultGraphTraversal)traversal).getSteps());
}
{code}
This produces,
{code:java}
[TinkerGraphStep(vertex,[]), VertexStep(BOTH,vertex), NoOpBarrierStep(2500),
VertexStep(BOTH,vertex), DedupGlobalStep(null,[VertexStep(OUT,edge),
CountGlobalStep]), OrderGlobalStep([[value([CoalesceStep([value(name),
(null)])]), asc]]), PropertiesStep([name],value)]
{code}
For some reason the {{OrderGlobalStep}} is moved to the end, after the
{{DedupGlobalStep}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)