wu-sheng commented on a change in pull request #10: used the nginx lua code 
style.
URL: 
https://github.com/apache/skywalking-nginx-lua/pull/10#discussion_r386102983
 
 

 ##########
 File path: lib/skywalking/tracing_context_test.lua
 ##########
 @@ -30,24 +31,24 @@ TestTracingContext = {}
     end
 
     function TestTracingContext:testInternal_NextSpanSeqID()
-        local context = TC:new(1, 1)
+        local context = TC.new(1, 1)
 
-        lu.assertEquals(context.internal:nextSpanID(), 0)
+        lu.assertEquals(TC_Internal.nextSpanID(context.internal), 0)
     end
 
     function TestTracingContext:testInternal_addActive()
-        local context = TC:new(1, 1)
+        local context = TC.new(1, 1)
 
         local mockSpan = {span_id = 0}
-        context.internal:addActive(mockSpan)
+        TC_Internal.addActive(context.internal, mockSpan)
 
-        lu.assertEquals(#(context.internal.active_spans), 1)
+        lu.assertEquals(#context.internal.active_spans, 1)
     end
 
     function TestTracingContext:testSpanStack()
-        local context = TC:new(1, 1)
-        local span1 = context:createEntrySpan('entry_op')
-        local span2 = context:createExitSpan("exit_op", span1, "127.0.0.1")
+        local context = TC.new(1, 1)
+        local span1 = TC.createEntrySpan(context, 'entry_op')
+        local span2 = TC.createExitSpan(context, "exit_op", span1, "127.0.0.1")
 
 Review comment:
   > There is no class in Lua, which needs to be simulated by table. Therefore, 
in nginx Lua, object-oriented programming mode is generally not recommended
   
   I am aware of this, but if refactoring all codes to out of OO, it will be 
hard to across check the the first-class java agent. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to