Skip to content

Commit 727cdfa

Browse files
authored
Change Concat.feature to order by name (#3270)
Change Concat.feature to order by name instead of id for providers that may not have ids with predictable order.
1 parent f08f428 commit 727cdfa

6 files changed

Lines changed: 9 additions & 8 deletions

File tree

CHANGELOG.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ This release also includes changes from <<release-3-7-XXX, 3.7.XXX>>.
128128
* Renamed `MergeElementStep` to `MergeElementStep` as it is a base class to `mergeV()` and `mergeE()`.
129129
* Renamed `MergeStep` of `merge()` to `MergeElementStep` for consistency.
130130
* Fixed referenced log file name for `gremlin-archetype-server`.
131+
* Changed some feature tests using `order()` to use specific `by()` modulators for better result predictability.
131132
* Upgraded Go to version 1.25.
132133
* Modified `RepeatUnrollStrategy` to use a more conservative approach, only unrolling repeat loops containing safe navigation and filtering steps.
133134
* Modified `limit()`, `skip()`, range()` in `repeat()` to track per-iteration counters.

gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ private static IDictionary<string, List<Func<GraphTraversalSource, IDictionary<s
10361036
{"g_injectXListXa_bXcX_concat_XdX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.Inject<object>(new List<object> { "a", "b" }, "c").Concat("d")}},
10371037
{"g_injectXnullX_concat_XinjectX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.Inject<object>(null).Concat()}},
10381038
{"g_injectXnull_aX_concat_Xnull_bX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.Inject<object>(null, "a").Concat(null, "b")}},
1039-
{"g_injectXhello_hiX_concat_XV_valuesXnameXX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.Inject<object>("hello", "hi").Concat(__.V().Order().By(T.Id).Values<object>("name"))}},
1039+
{"g_injectXhello_hiX_concatXV_values_order_byXnameX_valuesXnameXX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.Inject<object>("hello", "hi").Concat(__.V().Order().By("name").Values<object>("name"))}},
10401040
{"g_V_hasLabel_value_concat_X_X_concat_XpersonX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().HasLabel("person").Values<object>("name").Concat(" ").Concat("person")}},
10411041
{"g_hasLabelXpersonX_valuesXnameX_asXaX_constantXMrX_concatXselectXaX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().HasLabel("person").Values<object>("name").As("a").Constant<object>("Mr.").Concat(__.Select<object>("a"))}},
10421042
{"g_hasLabelXsoftwareX_asXaX_valuesXnameX_concatXunsesX_concatXselectXaXvaluesXlangX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().HasLabel("software").As("a").Values<object>("name").Concat(" uses ").Concat(__.Select<object>("a").Values<object>("lang"))}},

gremlin-go/driver/cucumber/gremlin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[
10061006
"g_injectXListXa_bXcX_concat_XdX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Inject([]interface{}{"a", "b"}, "c").Concat("d")}},
10071007
"g_injectXnullX_concat_XinjectX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Inject(nil).Concat()}},
10081008
"g_injectXnull_aX_concat_Xnull_bX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Inject(nil, "a").Concat(nil, "b")}},
1009-
"g_injectXhello_hiX_concat_XV_valuesXnameXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Inject("hello", "hi").Concat(gremlingo.T__.V().Order().By(gremlingo.T.Id).Values("name"))}},
1009+
"g_injectXhello_hiX_concatXV_values_order_byXnameX_valuesXnameXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Inject("hello", "hi").Concat(gremlingo.T__.V().Order().By("name").Values("name"))}},
10101010
"g_V_hasLabel_value_concat_X_X_concat_XpersonX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("person").Values("name").Concat(" ").Concat("person")}},
10111011
"g_hasLabelXpersonX_valuesXnameX_asXaX_constantXMrX_concatXselectXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("person").Values("name").As("a").Constant("Mr.").Concat(gremlingo.T__.Select("a"))}},
10121012
"g_hasLabelXsoftwareX_asXaX_valuesXnameX_concatXunsesX_concatXselectXaXvaluesXlangX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("software").As("a").Values("name").Concat(" uses ").Concat(gremlingo.T__.Select("a").Values("lang"))}},

gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/gremlin.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gremlin-python/src/main/python/radish/gremlin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@
10091009
'g_injectXListXa_bXcX_concat_XdX': [(lambda g:g.inject(['a', 'b'], 'c').concat('d'))],
10101010
'g_injectXnullX_concat_XinjectX': [(lambda g:g.inject(None).concat())],
10111011
'g_injectXnull_aX_concat_Xnull_bX': [(lambda g:g.inject(None, 'a').concat(None, 'b'))],
1012-
'g_injectXhello_hiX_concat_XV_valuesXnameXX': [(lambda g:g.inject('hello', 'hi').concat(__.V().order().by(T.id_).values('name')))],
1012+
'g_injectXhello_hiX_concatXV_values_order_byXnameX_valuesXnameXX': [(lambda g:g.inject('hello', 'hi').concat(__.V().order().by('name').values('name')))],
10131013
'g_V_hasLabel_value_concat_X_X_concat_XpersonX': [(lambda g:g.V().has_label('person').values('name').concat(' ').concat('person'))],
10141014
'g_hasLabelXpersonX_valuesXnameX_asXaX_constantXMrX_concatXselectXaX': [(lambda g:g.V().has_label('person').values('name').as_('a').constant('Mr.').concat(__.select('a')))],
10151015
'g_hasLabelXsoftwareX_asXaX_valuesXnameX_concatXunsesX_concatXselectXaXvaluesXlangX': [(lambda g:g.V().has_label('software').as_('a').values('name').concat(' uses ').concat(__.select('a').values('lang')))],

gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/Concat.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,17 @@ Feature: Step - concat()
118118
| ab |
119119

120120
@GraphComputerVerificationInjectionNotSupported
121-
Scenario: g_injectXhello_hiX_concat_XV_valuesXnameXX
121+
Scenario: g_injectXhello_hiX_concatXV_values_order_byXnameX_valuesXnameXX
122122
Given the modern graph
123123
And the traversal of
124124
"""
125-
g.inject("hello", "hi").concat(__.V().order().by(id).values("name"))
125+
g.inject("hello", "hi").concat(__.V().order().by("name").values("name"))
126126
"""
127127
When iterated to list
128128
Then the result should be unordered
129129
| result |
130-
| hellomarko |
131-
| himarko |
130+
| hellojosh |
131+
| hijosh |
132132

133133
Scenario: g_V_hasLabel_value_concat_X_X_concat_XpersonX
134134
Given the modern graph

0 commit comments

Comments
 (0)