You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by GitBox <gi...@apache.org> on 2022/10/12 14:21:25 UTC

[GitHub] [tinkerpop] FlorianHockmann opened a new pull request, #1827: TINKERPOP-2471 Add logging to .NET

FlorianHockmann opened a new pull request, #1827:
URL: https://github.com/apache/tinkerpop/pull/1827

   https://issues.apache.org/jira/browse/TINKERPOP-2471
   
   It's a bit unfortunate that I had to add loggers to the constructors of `GremlinClient` as well as `DriverRemoteConnection`, but I don't see a way around that as both are ways to initialize the driver.
   
   VOTE +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] FlorianHockmann commented on a diff in pull request #1827: TINKERPOP-2471 Add logging to .NET

Posted by GitBox <gi...@apache.org>.
FlorianHockmann commented on code in PR #1827:
URL: https://github.com/apache/tinkerpop/pull/1827#discussion_r994594215


##########
gremlin-dotnet/test/Gremlin.Net.UnitTest/Process/Traversal/BytecodeTests.cs:
##########
@@ -172,5 +172,16 @@ public void ShouldUseBindingsInsideHashSetInSourceArgument()
             var arg = bytecode.SourceInstructions[0].Arguments[0] as ISet<object>;
             Assert.Equal(new Binding("setVariable", "setValue"), arg.ToList()[1]);
         }
+
+        [Fact]
+        public void ShouldIncludeStepAndSourceInstructionsForToString()
+        {
+            var bytecode = new Bytecode();
+            bytecode.AddSource("source", 1, 2);
+            bytecode.AddStep("step1", 9, 8);
+            bytecode.AddStep("step2", 0);
+            
+            Assert.Equal("[[source(1, 2)], [step1(9, 8), step2(0)]]", bytecode.ToString());

Review Comment:
   Good suggestion! I actually didn't think about logging of `null` arguments which shouldn't be represented completely empty in the string representation so I changed `Instruction.ToString()` to properly handle `null` arguments.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] vkagamlyk commented on a diff in pull request #1827: TINKERPOP-2471 Add logging to .NET

Posted by GitBox <gi...@apache.org>.
vkagamlyk commented on code in PR #1827:
URL: https://github.com/apache/tinkerpop/pull/1827#discussion_r993637833


##########
gremlin-dotnet/test/Gremlin.Net.UnitTest/Process/Traversal/BytecodeTests.cs:
##########
@@ -172,5 +172,16 @@ public void ShouldUseBindingsInsideHashSetInSourceArgument()
             var arg = bytecode.SourceInstructions[0].Arguments[0] as ISet<object>;
             Assert.Equal(new Binding("setVariable", "setValue"), arg.ToList()[1]);
         }
+
+        [Fact]
+        public void ShouldIncludeStepAndSourceInstructionsForToString()
+        {
+            var bytecode = new Bytecode();
+            bytecode.AddSource("source", 1, 2);
+            bytecode.AddStep("step1", 9, 8);
+            bytecode.AddStep("step2", 0);
+            
+            Assert.Equal("[[source(1, 2)], [step1(9, 8), step2(0)]]", bytecode.ToString());

Review Comment:
   ```suggestion
               bytecode.AddStep("step1", 9, 8);
               bytecode.AddStep("step2", 0);
               bytecode.AddStep("step3", 0, null, 0d);
               bytecode.AddStep("step4", "0), stepX(\"hello\"");
   
               Assert.Equal("[[source(1, 2)], [step1(9, 8), step2(0), step3(0, , 0), step4(0), stepX(\"hello\")]]", 
                   bytecode.ToString());
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] vkagamlyk commented on a diff in pull request #1827: TINKERPOP-2471 Add logging to .NET

Posted by GitBox <gi...@apache.org>.
vkagamlyk commented on code in PR #1827:
URL: https://github.com/apache/tinkerpop/pull/1827#discussion_r993653729


##########
gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteConnection.cs:
##########
@@ -38,68 +40,69 @@ public class DriverRemoteConnection : IRemoteConnection, IDisposable
     {
         private readonly IGremlinClient _client;
         private readonly string _traversalSource;
-        
+        private readonly ILogger<DriverRemoteConnection> _logger;
+
         /// <summary>
         /// Filter on these keys provided to OptionsStrategy and apply them to the request. Note that
         /// "scriptEvaluationTimeout" was deprecated in 3.3.9 but still supported in server implementations and will
         /// be removed in later versions. 
         /// </summary>
-        private readonly List<String> _allowedKeys = new List<string> 
-                    {Tokens.ArgsEvalTimeout, "scriptEvaluationTimeout", Tokens.ArgsBatchSize, 
-                     Tokens.RequestId, Tokens.ArgsUserAgent};
+        private readonly List<string> _allowedKeys = new()
+        {
+            Tokens.ArgsEvalTimeout, "scriptEvaluationTimeout", Tokens.ArgsBatchSize,
+            Tokens.RequestId, Tokens.ArgsUserAgent
+        };
 
         private readonly string _sessionId;
         private string Processor => IsSessionBound ? Tokens.ProcessorSession : Tokens.ProcessorTraversal;
 
         /// <inheritdoc />
         public bool IsSessionBound => _sessionId != null;
-
-        /// <summary>
-        ///     Initializes a new <see cref="IRemoteConnection" /> using "g" as the default remote TraversalSource name.
-        /// </summary>
-        /// <param name="host">The host to connect to.</param>
-        /// <param name="port">The port to connect to.</param>
-        /// <exception cref="ArgumentNullException">Thrown when client is null.</exception>
-        public DriverRemoteConnection(string host, int port):this(host, port, "g")
-        {
-        }
-
+        
         /// <summary>
         ///     Initializes a new <see cref="IRemoteConnection" />.
         /// </summary>
         /// <param name="host">The host to connect to.</param>
         /// <param name="port">The port to connect to.</param>
         /// <param name="traversalSource">The name of the traversal source on the server to bind to.</param>
+        /// <param name="loggerFactory">A factory to create loggers. If not provided, then nothing will be logged.</param>
         /// <exception cref="ArgumentNullException">Thrown when client is null.</exception>
-        public DriverRemoteConnection(string host, int port, string traversalSource):this(new GremlinClient(new GremlinServer(host, port)), traversalSource)
+        public DriverRemoteConnection(string host, int port, string traversalSource = "g",
+            ILoggerFactory loggerFactory = null) : this(
+            new GremlinClient(new GremlinServer(host, port), loggerFactory: loggerFactory), traversalSource,
+            logger: loggerFactory != null
+                ? loggerFactory.CreateLogger<DriverRemoteConnection>()
+                : NullLogger<DriverRemoteConnection>.Instance)
         {
         }
 
         /// <summary>
-        ///     Initializes a new <see cref="IRemoteConnection" /> using "g" as the default remote TraversalSource name.
+        ///     Initializes a new <see cref="IRemoteConnection" />.
         /// </summary>
         /// <param name="client">The <see cref="IGremlinClient" /> that will be used for the connection.</param>
-        /// <exception cref="ArgumentNullException">Thrown when client is null.</exception>
-        public DriverRemoteConnection(IGremlinClient client):this(client, "g")
+        /// <param name="traversalSource">The name of the traversal source on the server to bind to.</param>
+        /// <exception cref="ArgumentNullException">Thrown when client or the traversalSource is null.</exception>
+        public DriverRemoteConnection(IGremlinClient client, string traversalSource = "g")
+            : this(client, traversalSource, null)
         {
         }
 
-        /// <summary>
-        ///     Initializes a new <see cref="IRemoteConnection" />.
-        /// </summary>
-        /// <param name="client">The <see cref="IGremlinClient" /> that will be used for the connection.</param>
-        /// <param name="traversalSource">The name of the traversal source on the server to bind to.</param>
-        /// <exception cref="ArgumentNullException">Thrown when client is null.</exception>
-        public DriverRemoteConnection(IGremlinClient client, string traversalSource)
+        private DriverRemoteConnection(IGremlinClient client, string traversalSource, string sessionId = null,
+            ILogger<DriverRemoteConnection> logger = null)
         {
             _client = client ?? throw new ArgumentNullException(nameof(client));
             _traversalSource = traversalSource ?? throw new ArgumentNullException(nameof(traversalSource));
-        }
 
-        private DriverRemoteConnection(IGremlinClient client, string traversalSource, Guid sessionId)
-            : this(client, traversalSource)
-        {
-            _sessionId = sessionId.ToString();
+            if (logger == null)

Review Comment:
   Logging is not covered by unit tests



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] FlorianHockmann merged pull request #1827: TINKERPOP-2471 Add logging to .NET

Posted by GitBox <gi...@apache.org>.
FlorianHockmann merged PR #1827:
URL: https://github.com/apache/tinkerpop/pull/1827


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] FlorianHockmann commented on a diff in pull request #1827: TINKERPOP-2471 Add logging to .NET

Posted by GitBox <gi...@apache.org>.
FlorianHockmann commented on code in PR #1827:
URL: https://github.com/apache/tinkerpop/pull/1827#discussion_r994596150


##########
gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteConnection.cs:
##########
@@ -38,68 +40,69 @@ public class DriverRemoteConnection : IRemoteConnection, IDisposable
     {
         private readonly IGremlinClient _client;
         private readonly string _traversalSource;
-        
+        private readonly ILogger<DriverRemoteConnection> _logger;
+
         /// <summary>
         /// Filter on these keys provided to OptionsStrategy and apply them to the request. Note that
         /// "scriptEvaluationTimeout" was deprecated in 3.3.9 but still supported in server implementations and will
         /// be removed in later versions. 
         /// </summary>
-        private readonly List<String> _allowedKeys = new List<string> 
-                    {Tokens.ArgsEvalTimeout, "scriptEvaluationTimeout", Tokens.ArgsBatchSize, 
-                     Tokens.RequestId, Tokens.ArgsUserAgent};
+        private readonly List<string> _allowedKeys = new()
+        {
+            Tokens.ArgsEvalTimeout, "scriptEvaluationTimeout", Tokens.ArgsBatchSize,
+            Tokens.RequestId, Tokens.ArgsUserAgent
+        };
 
         private readonly string _sessionId;
         private string Processor => IsSessionBound ? Tokens.ProcessorSession : Tokens.ProcessorTraversal;
 
         /// <inheritdoc />
         public bool IsSessionBound => _sessionId != null;
-
-        /// <summary>
-        ///     Initializes a new <see cref="IRemoteConnection" /> using "g" as the default remote TraversalSource name.
-        /// </summary>
-        /// <param name="host">The host to connect to.</param>
-        /// <param name="port">The port to connect to.</param>
-        /// <exception cref="ArgumentNullException">Thrown when client is null.</exception>
-        public DriverRemoteConnection(string host, int port):this(host, port, "g")
-        {
-        }
-
+        
         /// <summary>
         ///     Initializes a new <see cref="IRemoteConnection" />.
         /// </summary>
         /// <param name="host">The host to connect to.</param>
         /// <param name="port">The port to connect to.</param>
         /// <param name="traversalSource">The name of the traversal source on the server to bind to.</param>
+        /// <param name="loggerFactory">A factory to create loggers. If not provided, then nothing will be logged.</param>
         /// <exception cref="ArgumentNullException">Thrown when client is null.</exception>
-        public DriverRemoteConnection(string host, int port, string traversalSource):this(new GremlinClient(new GremlinServer(host, port)), traversalSource)
+        public DriverRemoteConnection(string host, int port, string traversalSource = "g",
+            ILoggerFactory loggerFactory = null) : this(
+            new GremlinClient(new GremlinServer(host, port), loggerFactory: loggerFactory), traversalSource,
+            logger: loggerFactory != null
+                ? loggerFactory.CreateLogger<DriverRemoteConnection>()
+                : NullLogger<DriverRemoteConnection>.Instance)
         {
         }
 
         /// <summary>
-        ///     Initializes a new <see cref="IRemoteConnection" /> using "g" as the default remote TraversalSource name.
+        ///     Initializes a new <see cref="IRemoteConnection" />.
         /// </summary>
         /// <param name="client">The <see cref="IGremlinClient" /> that will be used for the connection.</param>
-        /// <exception cref="ArgumentNullException">Thrown when client is null.</exception>
-        public DriverRemoteConnection(IGremlinClient client):this(client, "g")
+        /// <param name="traversalSource">The name of the traversal source on the server to bind to.</param>
+        /// <exception cref="ArgumentNullException">Thrown when client or the traversalSource is null.</exception>
+        public DriverRemoteConnection(IGremlinClient client, string traversalSource = "g")
+            : this(client, traversalSource, null)
         {
         }
 
-        /// <summary>
-        ///     Initializes a new <see cref="IRemoteConnection" />.
-        /// </summary>
-        /// <param name="client">The <see cref="IGremlinClient" /> that will be used for the connection.</param>
-        /// <param name="traversalSource">The name of the traversal source on the server to bind to.</param>
-        /// <exception cref="ArgumentNullException">Thrown when client is null.</exception>
-        public DriverRemoteConnection(IGremlinClient client, string traversalSource)
+        private DriverRemoteConnection(IGremlinClient client, string traversalSource, string sessionId = null,
+            ILogger<DriverRemoteConnection> logger = null)
         {
             _client = client ?? throw new ArgumentNullException(nameof(client));
             _traversalSource = traversalSource ?? throw new ArgumentNullException(nameof(traversalSource));
-        }
 
-        private DriverRemoteConnection(IGremlinClient client, string traversalSource, Guid sessionId)
-            : this(client, traversalSource)
-        {
-            _sessionId = sessionId.ToString();
+            if (logger == null)

Review Comment:
   I usually don't test logging because it's not really part of the business logic, but I guess for an open-source library, it makes sense to at least have some testing. I just added some tests that at least check that some expected log messages are logged and that the `DriverRemoteConnection` can use the `LoggerFactory` that was provided to the `GremlinClient` constructor.
   
   Do you have any other tests in mind?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] vkagamlyk commented on a diff in pull request #1827: TINKERPOP-2471 Add logging to .NET

Posted by GitBox <gi...@apache.org>.
vkagamlyk commented on code in PR #1827:
URL: https://github.com/apache/tinkerpop/pull/1827#discussion_r993624509


##########
gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteConnection.cs:
##########
@@ -38,68 +40,69 @@ public class DriverRemoteConnection : IRemoteConnection, IDisposable
     {
         private readonly IGremlinClient _client;
         private readonly string _traversalSource;
-        
+        private readonly ILogger<DriverRemoteConnection> _logger;
+
         /// <summary>
         /// Filter on these keys provided to OptionsStrategy and apply them to the request. Note that
         /// "scriptEvaluationTimeout" was deprecated in 3.3.9 but still supported in server implementations and will
         /// be removed in later versions. 
         /// </summary>
-        private readonly List<String> _allowedKeys = new List<string> 
-                    {Tokens.ArgsEvalTimeout, "scriptEvaluationTimeout", Tokens.ArgsBatchSize, 
-                     Tokens.RequestId, Tokens.ArgsUserAgent};
+        private readonly List<string> _allowedKeys = new()
+        {
+            Tokens.ArgsEvalTimeout, "scriptEvaluationTimeout", Tokens.ArgsBatchSize,
+            Tokens.RequestId, Tokens.ArgsUserAgent
+        };
 
         private readonly string _sessionId;
         private string Processor => IsSessionBound ? Tokens.ProcessorSession : Tokens.ProcessorTraversal;
 
         /// <inheritdoc />
         public bool IsSessionBound => _sessionId != null;
-
-        /// <summary>
-        ///     Initializes a new <see cref="IRemoteConnection" /> using "g" as the default remote TraversalSource name.
-        /// </summary>
-        /// <param name="host">The host to connect to.</param>
-        /// <param name="port">The port to connect to.</param>
-        /// <exception cref="ArgumentNullException">Thrown when client is null.</exception>
-        public DriverRemoteConnection(string host, int port):this(host, port, "g")
-        {
-        }
-
+        
         /// <summary>
         ///     Initializes a new <see cref="IRemoteConnection" />.
         /// </summary>
         /// <param name="host">The host to connect to.</param>
         /// <param name="port">The port to connect to.</param>
         /// <param name="traversalSource">The name of the traversal source on the server to bind to.</param>
+        /// <param name="loggerFactory">A factory to create loggers. If not provided, then nothing will be logged.</param>
         /// <exception cref="ArgumentNullException">Thrown when client is null.</exception>
-        public DriverRemoteConnection(string host, int port, string traversalSource):this(new GremlinClient(new GremlinServer(host, port)), traversalSource)
+        public DriverRemoteConnection(string host, int port, string traversalSource = "g",
+            ILoggerFactory loggerFactory = null) : this(
+            new GremlinClient(new GremlinServer(host, port), loggerFactory: loggerFactory), traversalSource,
+            logger: loggerFactory != null
+                ? loggerFactory.CreateLogger<DriverRemoteConnection>()
+                : NullLogger<DriverRemoteConnection>.Instance)

Review Comment:
   ```suggestion
               logger: loggerFactory?.CreateLogger<DriverRemoteConnection>() ?? NullLogger<DriverRemoteConnection>.Instance)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] vkagamlyk commented on a diff in pull request #1827: TINKERPOP-2471 Add logging to .NET

Posted by GitBox <gi...@apache.org>.
vkagamlyk commented on code in PR #1827:
URL: https://github.com/apache/tinkerpop/pull/1827#discussion_r994887901


##########
gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteConnection.cs:
##########
@@ -38,68 +40,69 @@ public class DriverRemoteConnection : IRemoteConnection, IDisposable
     {
         private readonly IGremlinClient _client;
         private readonly string _traversalSource;
-        
+        private readonly ILogger<DriverRemoteConnection> _logger;
+
         /// <summary>
         /// Filter on these keys provided to OptionsStrategy and apply them to the request. Note that
         /// "scriptEvaluationTimeout" was deprecated in 3.3.9 but still supported in server implementations and will
         /// be removed in later versions. 
         /// </summary>
-        private readonly List<String> _allowedKeys = new List<string> 
-                    {Tokens.ArgsEvalTimeout, "scriptEvaluationTimeout", Tokens.ArgsBatchSize, 
-                     Tokens.RequestId, Tokens.ArgsUserAgent};
+        private readonly List<string> _allowedKeys = new()
+        {
+            Tokens.ArgsEvalTimeout, "scriptEvaluationTimeout", Tokens.ArgsBatchSize,
+            Tokens.RequestId, Tokens.ArgsUserAgent
+        };
 
         private readonly string _sessionId;
         private string Processor => IsSessionBound ? Tokens.ProcessorSession : Tokens.ProcessorTraversal;
 
         /// <inheritdoc />
         public bool IsSessionBound => _sessionId != null;
-
-        /// <summary>
-        ///     Initializes a new <see cref="IRemoteConnection" /> using "g" as the default remote TraversalSource name.
-        /// </summary>
-        /// <param name="host">The host to connect to.</param>
-        /// <param name="port">The port to connect to.</param>
-        /// <exception cref="ArgumentNullException">Thrown when client is null.</exception>
-        public DriverRemoteConnection(string host, int port):this(host, port, "g")
-        {
-        }
-
+        
         /// <summary>
         ///     Initializes a new <see cref="IRemoteConnection" />.
         /// </summary>
         /// <param name="host">The host to connect to.</param>
         /// <param name="port">The port to connect to.</param>
         /// <param name="traversalSource">The name of the traversal source on the server to bind to.</param>
+        /// <param name="loggerFactory">A factory to create loggers. If not provided, then nothing will be logged.</param>
         /// <exception cref="ArgumentNullException">Thrown when client is null.</exception>
-        public DriverRemoteConnection(string host, int port, string traversalSource):this(new GremlinClient(new GremlinServer(host, port)), traversalSource)
+        public DriverRemoteConnection(string host, int port, string traversalSource = "g",
+            ILoggerFactory loggerFactory = null) : this(
+            new GremlinClient(new GremlinServer(host, port), loggerFactory: loggerFactory), traversalSource,
+            logger: loggerFactory != null
+                ? loggerFactory.CreateLogger<DriverRemoteConnection>()
+                : NullLogger<DriverRemoteConnection>.Instance)
         {
         }
 
         /// <summary>
-        ///     Initializes a new <see cref="IRemoteConnection" /> using "g" as the default remote TraversalSource name.
+        ///     Initializes a new <see cref="IRemoteConnection" />.
         /// </summary>
         /// <param name="client">The <see cref="IGremlinClient" /> that will be used for the connection.</param>
-        /// <exception cref="ArgumentNullException">Thrown when client is null.</exception>
-        public DriverRemoteConnection(IGremlinClient client):this(client, "g")
+        /// <param name="traversalSource">The name of the traversal source on the server to bind to.</param>
+        /// <exception cref="ArgumentNullException">Thrown when client or the traversalSource is null.</exception>
+        public DriverRemoteConnection(IGremlinClient client, string traversalSource = "g")
+            : this(client, traversalSource, null)
         {
         }
 
-        /// <summary>
-        ///     Initializes a new <see cref="IRemoteConnection" />.
-        /// </summary>
-        /// <param name="client">The <see cref="IGremlinClient" /> that will be used for the connection.</param>
-        /// <param name="traversalSource">The name of the traversal source on the server to bind to.</param>
-        /// <exception cref="ArgumentNullException">Thrown when client is null.</exception>
-        public DriverRemoteConnection(IGremlinClient client, string traversalSource)
+        private DriverRemoteConnection(IGremlinClient client, string traversalSource, string sessionId = null,
+            ILogger<DriverRemoteConnection> logger = null)
         {
             _client = client ?? throw new ArgumentNullException(nameof(client));
             _traversalSource = traversalSource ?? throw new ArgumentNullException(nameof(traversalSource));
-        }
 
-        private DriverRemoteConnection(IGremlinClient client, string traversalSource, Guid sessionId)
-            : this(client, traversalSource)
-        {
-            _sessionId = sessionId.ToString();
+            if (logger == null)

Review Comment:
   I think enough added tests.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] vkagamlyk commented on a diff in pull request #1827: TINKERPOP-2471 Add logging to .NET

Posted by GitBox <gi...@apache.org>.
vkagamlyk commented on code in PR #1827:
URL: https://github.com/apache/tinkerpop/pull/1827#discussion_r993637833


##########
gremlin-dotnet/test/Gremlin.Net.UnitTest/Process/Traversal/BytecodeTests.cs:
##########
@@ -172,5 +172,16 @@ public void ShouldUseBindingsInsideHashSetInSourceArgument()
             var arg = bytecode.SourceInstructions[0].Arguments[0] as ISet<object>;
             Assert.Equal(new Binding("setVariable", "setValue"), arg.ToList()[1]);
         }
+
+        [Fact]
+        public void ShouldIncludeStepAndSourceInstructionsForToString()
+        {
+            var bytecode = new Bytecode();
+            bytecode.AddSource("source", 1, 2);
+            bytecode.AddStep("step1", 9, 8);
+            bytecode.AddStep("step2", 0);
+            
+            Assert.Equal("[[source(1, 2)], [step1(9, 8), step2(0)]]", bytecode.ToString());

Review Comment:
   ```suggestion
               bytecode.AddStep("step3", 0, null, 0d);
               bytecode.AddStep("step4", "0), stepX(\"hello\"");
   
               Assert.Equal("[[source(1, 2)], [step1(9, 8), step2(0), step3(0, , 0), step4(0), stepX(\"hello\")]]", 
                   bytecode.ToString());
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tinkerpop] codecov-commenter commented on pull request #1827: TINKERPOP-2471 Add logging to .NET

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #1827:
URL: https://github.com/apache/tinkerpop/pull/1827#issuecomment-1277610769

   # [Codecov](https://codecov.io/gh/apache/tinkerpop/pull/1827?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1827](https://codecov.io/gh/apache/tinkerpop/pull/1827?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (dc30d07) into [3.5-dev](https://codecov.io/gh/apache/tinkerpop/commit/62ae81216b4cd9b5c4f209e9c40b6b912af8ad2e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (62ae812) will **increase** coverage by `0.03%`.
   > The diff coverage is `40.00%`.
   
   ```diff
   @@              Coverage Diff              @@
   ##             3.5-dev    #1827      +/-   ##
   =============================================
   + Coverage      69.38%   69.42%   +0.03%     
   - Complexity      8924     8926       +2     
   =============================================
     Files            861      861              
     Lines          40858    40860       +2     
     Branches        5384     5385       +1     
   =============================================
   + Hits           28350    28367      +17     
   + Misses         10606    10592      -14     
   + Partials        1902     1901       -1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/tinkerpop/pull/1827?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...trategy/optimization/TinkerGraphCountStrategy.java](https://codecov.io/gh/apache/tinkerpop/pull/1827/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-dGlua2VyZ3JhcGgtZ3JlbWxpbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvdGlua2VycG9wL2dyZW1saW4vdGlua2VyZ3JhcGgvcHJvY2Vzcy90cmF2ZXJzYWwvc3RyYXRlZ3kvb3B0aW1pemF0aW9uL1RpbmtlckdyYXBoQ291bnRTdHJhdGVneS5qYXZh) | `85.00% <0.00%> (ø)` | |
   | [...lin/process/computer/traversal/WorkerExecutor.java](https://codecov.io/gh/apache/tinkerpop/pull/1827/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Z3JlbWxpbi1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS90aW5rZXJwb3AvZ3JlbWxpbi9wcm9jZXNzL2NvbXB1dGVyL3RyYXZlcnNhbC9Xb3JrZXJFeGVjdXRvci5qYXZh) | `90.26% <50.00%> (-1.63%)` | :arrow_down: |
   | [.../step/map/ConnectedComponentVertexProgramStep.java](https://codecov.io/gh/apache/tinkerpop/pull/1827/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Z3JlbWxpbi1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS90aW5rZXJwb3AvZ3JlbWxpbi9wcm9jZXNzL2NvbXB1dGVyL3RyYXZlcnNhbC9zdGVwL21hcC9Db25uZWN0ZWRDb21wb25lbnRWZXJ0ZXhQcm9ncmFtU3RlcC5qYXZh) | `70.58% <0.00%> (-5.89%)` | :arrow_down: |
   | [...in/process/traversal/dsl/graph/GraphTraversal.java](https://codecov.io/gh/apache/tinkerpop/pull/1827/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Z3JlbWxpbi1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS90aW5rZXJwb3AvZ3JlbWxpbi9wcm9jZXNzL3RyYXZlcnNhbC9kc2wvZ3JhcGgvR3JhcGhUcmF2ZXJzYWwuamF2YQ==) | `90.63% <0.00%> (-0.19%)` | :arrow_down: |
   | [...e/tinkerpop/gremlin/server/util/MetricManager.java](https://codecov.io/gh/apache/tinkerpop/pull/1827/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Z3JlbWxpbi1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3RpbmtlcnBvcC9ncmVtbGluL3NlcnZlci91dGlsL01ldHJpY01hbmFnZXIuamF2YQ==) | `52.48% <0.00%> (+0.55%)` | :arrow_up: |
   | [gremlin-go/driver/gorillaTransporter.go](https://codecov.io/gh/apache/tinkerpop/pull/1827/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Z3JlbWxpbi1nby9kcml2ZXIvZ29yaWxsYVRyYW5zcG9ydGVyLmdv) | `66.98% <0.00%> (+2.83%)` | :arrow_up: |
   | [.../traversal/step/map/PageRankVertexProgramStep.java](https://codecov.io/gh/apache/tinkerpop/pull/1827/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Z3JlbWxpbi1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS90aW5rZXJwb3AvZ3JlbWxpbi9wcm9jZXNzL2NvbXB1dGVyL3RyYXZlcnNhbC9zdGVwL21hcC9QYWdlUmFua1ZlcnRleFByb2dyYW1TdGVwLmphdmE=) | `76.74% <0.00%> (+4.65%)` | :arrow_up: |
   | [...rg/apache/tinkerpop/gremlin/driver/Connection.java](https://codecov.io/gh/apache/tinkerpop/pull/1827/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Z3JlbWxpbi1kcml2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3RpbmtlcnBvcC9ncmVtbGluL2RyaXZlci9Db25uZWN0aW9uLmphdmE=) | `66.89% <0.00%> (+9.45%)` | :arrow_up: |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org