-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add tests for world modelling tools. #19
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I see that it runs as part of the automated tests (yay pytest), and only have minor comments.
@sea-bass I have updated the tests, let me know if this is a right direction to proceed in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The class + static method + dependencies approach lets you incrementally build the world so you don't have to build one from scratch at each test, right? If so, that is great.
Some general pointers besides the nitpicky stuff in the comments:
- I assume in this same file we'll do tests for adding locations, objects, and robots right?
- You definitely want to add "remove_X" tests and check that the sizes decrease -- plus in that case you want to check that the attached objects also disappear depending on the rules. For example, if you remove a table with 2 objects on top of it, those should go away. Or if you remove a room with 2 tables, those should go away too.
- Generally, you can assert on more things than just number of entities + name. Like, if you add an entity at a particular pose and with a certain color, you can also check those properties are as expected (where applicable). For the
Room
entity, not a big deal since it's added directly, but for others it might be useful. - An example of the above that absolutely could use tests is checking automatically generated names. For example, adding 3 apples without explicitly specifying names will name the objects
apple0
,apple1
, etc. - We want to also test for invalid input, within reason. For example, adding entities that don't have defined categories (like adding an orange when we only have apples and bananas in our list), and removing entities that don't actually exist in the world.
With something along the guidelines above, I would consider there being a good test suite for the "core" world modeling tools.
That being said, some tests are better than none. Whenever you feel you're at a stopping point, let me know and I'll stop suggesting more things to do and move towards approving whatever you want to contribute.
Thank you!
Thanks for the inputs !
Yes that's right and I also found it helpful with skipping rest of the tests if a prior test failed.
Yes, I intent to add the rest of the tests to the same file since it can be built incrementally in the class |
f512d3a
to
b3a00d5
Compare
@sea-bass I tried checking for automatic hierarchical clean up by having a room with a location and an object on that location Is this an expected behaviour ? , I did not see any logic implemented in the remove_location ( ) or remove_room ( ) that does the expected cleanup. |
I guess this is not in place, now that I read the code... hah. Maybe I should make a gitissue for this. EDIT: Made #58 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good!
My comments are half useful, half formatting.
... I should really add auto-formatting hooks to this repo soon.
Co-authored-by: Sebastian Castro <4603398+sea-bass@users.noreply.github.com>
Co-authored-by: Sebastian Castro <4603398+sea-bass@users.noreply.github.com>
Normally I'd also say this can go in a separate PR, but no big deal since you started it. Just make sure you also add the same for And, you can always rebase on / merge main! |
I think we can merge this PR now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mostly see a few typos, and possibly missing dependencies in the new test, so once those are fixed up let's get this in.
Thank you!
This PR will incrementally add tests for the world modelling tools.
Closes #58