Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit test state #3

Closed
matthiashh opened this issue Feb 28, 2019 · 4 comments
Closed

Unit test state #3

matthiashh opened this issue Feb 28, 2019 · 4 comments

Comments

@matthiashh
Copy link

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:

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

  2. In both tests specType should be 2 but is 0. 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.

@frovida
Copy link

frovida commented Mar 1, 2019

Indeed they haven't =) Thanks for reporting the issue

@matthiashh
Copy link
Author

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.

@frovida
Copy link

frovida commented Apr 26, 2019

Unit test works now, but I will keep this open and make some more tests.

@matthias-mayr
Copy link
Member

More tests were added with e7a6e2f and e7a6e2f.
Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants