This is an automated email from the ASF dual-hosted git repository. florianhockmann pushed a commit to branch TINKERPOP-2518-master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit 4feae0a54231fe8f6fc546e0de011027c9898f62 Author: Florian Hockmann <[email protected]> AuthorDate: Fri Feb 11 14:01:02 2022 +0100 TINKERPOP-2518 Fix remaining scenarios on master This unconvered a bug in the HasId step that threw a `NullReferenceException` if the second argument was `null`. We probably have the same problem with other steps that are just not tested yet for `null`. I however haven't touched them here as I'm not sure yet where we actually want to allow `null`. Ignoring the tag `AllowNullPropertyValues` automatically in .NET simply didn't work as we checked for the tag on the feature, but it's on the scenario. --- .../Process/Traversal/GraphTraversal.cs | 12 +++++++++-- .../Gherkin/GherkinTestRunner.cs | 25 ++++------------------ 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs index ebd1cdf..deb87c5 100644 --- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs @@ -772,8 +772,16 @@ namespace Gremlin.Net.Process.Traversal /// </summary> public GraphTraversal<S, E> HasId (object id, params object[] otherIds) { - var args = new List<object>(1 + otherIds.Length) {id}; - args.AddRange(otherIds); + List<object> args; + if (otherIds == null) + { + args = new List<object> { id, null }; + } + else + { + args = new List<object>(1 + otherIds.Length) { id }; + args.AddRange(otherIds); + } Bytecode.AddStep("hasId", args.ToArray()); return Wrap<S, E>(this); } diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs index dc78ad8..a2c8ed2 100644 --- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs +++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs @@ -44,27 +44,10 @@ namespace Gremlin.Net.IntegrationTest.Gherkin new Dictionary<string, IgnoreReason> { // Add here the name of scenarios to ignore and the reason, e.g.: - {"g_withStrategiesXProductiveByStrategyX_V_group_byXageX", IgnoreReason.NullKeysInMapNotSupported}, - {"g_withStrategiesXProductiveByStrategyX_V_groupCount_byXageX", IgnoreReason.NullKeysInMapNotSupported}, - - // they are not failing as a result of the Gremlin itself - they are failing because of shortcomings in - // the test suite. - // https://issues.apache.org/jira/browse/TINKERPOP-2518 - {"g_V_hasIdXnullX", IgnoreReason.NoReason}, - {"g_V_hasIdXeqXnullXX", IgnoreReason.NoReason}, - {"g_V_hasIdX2_nullX", IgnoreReason.NoReason}, - {"g_V_hasIdX2AsString_nullX", IgnoreReason.NoReason}, - { - "g_addVXpersonX_propertyXname_joshX_propertyXage_nullX", - IgnoreReason.NoReason - }, - { - "g_addVXpersonX_propertyXname_markoX_propertyXfriendWeight_null_acl_nullX", - IgnoreReason.NoReason - }, + { "g_withStrategiesXProductiveByStrategyX_V_group_byXageX", IgnoreReason.NullKeysInMapNotSupported }, { - "g_addEXknowsXpropertyXweight_nullXfromXV_hasXname_markoXX_toXV_hasXname_vadasXX", - IgnoreReason.NoReason + "g_withStrategiesXProductiveByStrategyX_V_groupCount_byXageX", + IgnoreReason.NullKeysInMapNotSupported } }; @@ -123,7 +106,7 @@ namespace Gremlin.Net.IntegrationTest.Gherkin continue; } - if (feature.Tags.Select(t => t.Name).ToList().Contains("@AllowNullPropertyValues")) + if (scenario.Tags.Any(t => t.Name == "@AllowNullPropertyValues")) { failedSteps.Add(scenario.Steps.First(), new IgnoreException(IgnoreReason.NullPropertyValuesNotSupportedOnTestGraph)); continue;
