GumpacG commented on code in PR #3397:
URL: https://github.com/apache/tinkerpop/pull/3397#discussion_r3150489928


##########
gremlin-go/driver/client_test.go:
##########
@@ -158,6 +158,37 @@ func TestClient(t *testing.T) {
                AssertMarkoVertexWithoutProperties(t, result)
        })
 
+       t.Run("Test client.SubmitWithOptions() with bulkResults", func(t 
*testing.T) {
+               skipTestsIfNotEnabled(t, integrationTestSuiteName, 
testNoAuthEnable)
+               client, err := NewClient(testNoAuthUrl,
+                       func(settings *ClientSettings) {
+                               settings.TlsConfig = testNoAuthTlsConfig
+                       })
+               assert.NoError(t, err)
+               assert.NotNil(t, client)
+               defer client.Close()
+
+               resultSet, err := 
client.SubmitWithOptions("g.inject(1,2,3,2,1)",
+                       
new(RequestOptionsBuilder).SetBulkResults(true).Create())
+               assert.NoError(t, err)
+               assert.NotNil(t, resultSet)
+               results, err := resultSet.All()
+               assert.NoError(t, err)
+               // With bulkResults=true, the ResultSet contains Traverser 
objects (one per unique value).
+               // This is consistent with Java, Python, .NET, and JS which all 
expose Traverser objects
+               // at the ResultSet level when bulking is enabled.
+               totalBulk := int64(0)
+               for _, r := range results {
+                       tr, err := r.GetTraverser()
+                       if err == nil {
+                               totalBulk += tr.Bulk
+                       } else {
+                               totalBulk++
+                       }
+               }
+               assert.Equal(t, int64(5), totalBulk)

Review Comment:
   Can you add a check for the amount of traversers as that would confirm that 
it is getting bulked properly.
   
   Should there be a test for when `SetBulkResults(false)` where an error 
should be returned since there are no traversers?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to