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

remove unittest test_models #32465

Closed
wants to merge 2 commits into from

Conversation

cl0cks4fe
Copy link
Contributor

  • removes unittest from openpilot.selfdrive.car.tests.test_models.py
  • switches tools/car_porting/test_car_model.py to inherit from test_models.py

not totally ideal but keeps use

Copy link
Contributor

github-actions bot commented May 18, 2024

Thanks for contributing to openpilot! In order for us to review your PR as quickly as possible, check the following:

  • Convert your PR to a draft unless it's ready to review
  • Read the contributing docs
  • Before marking as "ready for review", ensure:
    • the goal is clearly stated in the description
    • all the tests are passing
    • the change is something we merge
    • include a route or your device' dongle ID if relevant

@cl0cks4fe
Copy link
Contributor Author

skips base class tests but so does test_models

@cl0cks4fe cl0cks4fe marked this pull request as ready for review May 18, 2024 17:23
Comment on lines +14 to +16
route_or_segment_name = SegmentName(route, allow_route_name=True)
segment_num = route_or_segment_name.segment_num if route_or_segment_name.segment_num != -1 else None
test_route = CarTestRoute(route_or_segment_name.route_name.canonical_name, car, segment=segment_num)
Copy link
Contributor

Choose a reason for hiding this comment

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

all this stuff runs at import time now. it should only be run if we're running this script

from openpilot.tools.lib.route import SegmentName

route = os.getenv('ROUTE')
Copy link
Contributor

Choose a reason for hiding this comment

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

this is now harder to use without the argparser. can we bring that back?

@cl0cks4fe
Copy link
Contributor Author

@adeebshihadeh because of pytest discovery, lose something similar to loadTestsFromTestCase to run this as script, i'll revisit

@cl0cks4fe cl0cks4fe closed this May 19, 2024
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.

None yet

2 participants