surahman commented on a change in pull request #3786:
URL: https://github.com/apache/incubator-heron/pull/3786#discussion_r836907557



##########
File path: heron/tools/tracker/src/python/routers/container.py
##########
@@ -143,8 +142,8 @@ class ExceptionLog(BaseModel):
   hostname: str
   instance_id: str
   stack_trace: str = Field(..., alias="stacktrace")
-  last_time: int = Field(..., alias="lasttime")
-  first_time: int = Field(..., alias="firsttime")
+  last_time: str = Field(..., alias="lasttime")
+  first_time: str = Field(..., alias="firsttime")

Review comment:
       We need to be careful with this. One of the many oddities and quirks of 
Python is that assigning values of different types to a variable will convert 
the type of the variable.
   
   ```python
   test: str = "test string"
   print (type(test))
   
   test = 6
   print (type(test))
   
   #####
   
   number: int = -1
   print(type(number))
   
   test = "test string"
   number = test
   print(type(number))
   ```

##########
File path: heron/tools/tracker/tests/python/app_unittest.py
##########
@@ -34,19 +34,31 @@ def test_clusters(client, tracker):
 
   tracker.state_managers = [c1, c2]
   response = client.get("/clusters")
-  assert response.json() == ok(["c1", "c2"])
+  assert response.json() == ok({'executiontime': 0.0,
+                                'message': 'ok',
+                                'result': {},
+                                'status': 'success',
+                                'tracker_version': '0.1.0'})
   assert response.status_code == 200
 
 def test_machines(client):
   response = client.get("/machines", json={
       "cluster": ["c1", "c3"],
       "environ": ["e1", "e3"],
   })
-  assert response.json() == ok({})
+  assert response.json() == ok({'executiontime': 0.0,
+                                'message': 'ok',
+                                'result': {},
+                                'status': 'success',
+                                'tracker_version': '0.1.0'})
 
 def test_topologies(client):
   response = client.get("/topologies", json={
       "cluster": [],
       "environ": [],
   })
-  assert response.json() == ok({})
+  assert response.json() == ok({'executiontime': 0.0,
+                                'message': 'ok',
+                                'result': {},
+                                'status': 'success',
+                                'tracker_version': '0.1.0'})

Review comment:
       These tests should be updated to match what needs to be happening in the 
production code.




-- 
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