skiros2
skiros2 copied to clipboard
Unit test state
I am currently looking at the unit tests and quite a lot of them fail on my platform and there could be several reasons for that.
========= Testing json serialization =========
**********************************************************************
File "/home/matthias/catkin_ws/src/skiros2/skiros2_common/src/skiros2_common/ros/utils.py", line 226, in skiros2_common.ros.utils.serializeParamMap
Failed example:
serializeParamMap(ph._params)
Expected:
[param: {"values": [], "specType": 2, "type": "dict", "description": "", "key": "MyDict"}]
Got:
[param: "{\"values\": [], \"specType\": 0, \"type\": \"dict\", \"description\": \"\", \"key\"\
: \"MyDict\"}"]
**********************************************************************
File "/home/matthias/catkin_ws/src/skiros2/skiros2_common/src/skiros2_common/ros/utils.py", line 229, in skiros2_common.ros.utils.serializeParamMap
Failed example:
serializeParamMap(ph._params)
Expected:
[param: {"values": [], "specType": 2, "type": "list", "description": "", "key": "MyList"}, param: {"values": [], "specType": 2, "type": "dict", "description": "", "key": "MyDict"}]
Got:
[param: "{\"values\": [], \"specType\": 0, \"type\": \"list\", \"description\": \"\", \"key\"\
: \"MyList\"}", param: "{\"values\": [], \"specType\": 0, \"type\": \"dict\", \"description\": \"\", \"key\"\
: \"MyDict\"}"]
There's several things here:
-
I get a lot of those backslashes in my results. I can compensate in the test result of course, but I was wondering if this is something platform specific since I am running Ubuntu 18.04 and python 2.7.
-
In both tests
specType
should be2
but is0
. Is the unittest outdated or is there a bug in the code?
There is also some of those:
File "/home/matthias/catkin_ws/src/skiros2_std_lib/skiros2_std_reasoners/src/skiros2_std_reasoners/aau_spatial_reasoner.py", line 465, in skiros2_std_reasoners.aau_spatial_reasoner.AauSpatialReasoner._getAIRelations
Failed example:
sr._getAIRelations(3, 3, 3, 3, 'X')
Expected:
[':mX']
Got:
[':mX', 0.0]
But looking at the code it looks like the test hasn't been updated.
Indeed they haven't =) Thanks for reporting the issue
I fixed all the ones on the master branch in my local development branch. I can push that one later and create a pull request. I marked all the changes in values with "TODO" so they should be quite obvious.
Unit test works now, but I will keep this open and make some more tests.
More tests were added with e7a6e2ff8bf124b8098d410590a28629a5861e66 and e7a6e2ff8bf124b8098d410590a28629a5861e66. Closing