Skip to content

RSDK-13254: example tests#1079

Draft
allisonschiang wants to merge 13 commits intoviamrobotics:mainfrom
allisonschiang:RSDK-13254
Draft

RSDK-13254: example tests#1079
allisonschiang wants to merge 13 commits intoviamrobotics:mainfrom
allisonschiang:RSDK-13254

Conversation

@allisonschiang
Copy link
Member

No description provided.

@@ -1,4 +1,4 @@
from typing import ClassVar, Mapping, Sequence, cast
Copy link
Member Author

@allisonschiang allisonschiang Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FAILED tests/test_examples.py::TestExamplesImports::test_python_file_imports[optionaldepsmodule/module.py] - TypeError: 'type' object is not subscriptable

this was incompatible with python 3.8.2

return await self.left.is_moving() or await self.right.is_moving()

# Not implemented
async def get_properties(self, *, timeout: Optional[float] | None = None, **kwargs) -> Base.Properties:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FAILED tests/test_examples.py::TestExamplesImports::test_python_file_imports[complex_module/src/base/my_base.py] - TypeError: unsupported operand type(s) for |: '_GenericAlias' and 'NoneType'

This was incompatible with version 3.8.2

req = ReadyRequest(parent_address=p_addr)
resp = await module.ready(req)
assert module._parent_address == p_addr
assert len(resp.handlermap.handlers) == 2
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test is failing because my text_examples register resources as they build the files. To fix it, I made it so instead of checking the length of handlermap.handlers, it iterates through them looking for the resource and then ensures that model is correct and theres only one of them

@allisonschiang allisonschiang marked this pull request as ready for review February 3, 2026 21:41
@allisonschiang allisonschiang requested a review from a team as a code owner February 3, 2026 21:41
Copy link
Member

@stuqdog stuqdog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this all looks reasonable to me, but there isn't any detail in the description as to what the goal is here and I don't have that context already, so I'm a bit hesitant to approve. Is it the case that we're just validating that imports work? It doesn't look like this actually uses the examples in any meaningful way, unless I'm missing something?

@allisonschiang
Copy link
Member Author

this all looks reasonable to me, but there isn't any detail in the description as to what the goal is here and I don't have that context already, so I'm a bit hesitant to approve. Is it the case that we're just validating that imports work? It doesn't look like this actually uses the examples in any meaningful way, unless I'm missing something?

My understanding is that this epic just makes sure that everything builds and doesn't go deeper into checking it builds exactly as we intend it to(future feature?). I can confirm in today's meeting

Copy link
Member

@njooma njooma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In last week's meeting, we decided to not test imports but rather test BUILDING the modules. This can be done by importing the server side code and client side code into a test, then running both to make sure everything is behaving as expected

@allisonschiang allisonschiang marked this pull request as draft February 12, 2026 18:35
for d in sorted(EXAMPLES_DIR.iterdir()):
if not d.is_dir():
continue
for candidate in [d / "src" / "main.py", d / "main.py", d / "module.py", d / "v1" / "server.py"]:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

theres no consistent entrypoint in the examples, so to keep it dynamic (in case we add new examples in the future) I'm just adding in the most popular ones)

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

Successfully merging this pull request may close these issues.

3 participants