openpilot icon indicating copy to clipboard operation
openpilot copied to clipboard

Test LogReader scenarios for auto_source

Open mpetkovic96 opened this issue 1 year ago • 4 comments

for #31223 no logs available -> should error for all query types: test fail for all query types. rlogs not available, but qlogs are -> should error with /r, pass with /q and /a: test pass for /q, but fail for /r and /a. rlogs only available for specific segments, but qlogs are available for the rest -> should error with /r, pass with /a: pass with /r, error with /a. rlog not available on comma api, but is available from another source (openpilot ci bucket, commaCarSegments), rlogs should be parsed: test return comma_api, where is not available rlog. I wrote a few tests for auto_source, just to make sure this is a good approach. As you can see, I have deviations from the expected results in several cases. In that case, is it necessary to modify the auto_source function, or is a different approach to the test needed? For the case where rlog is not available on the comma api, the test just checks the return from auto_source. Can you explain what you mean by rlogs should be parsed? If the return from auto_source is rlog on the comma api, where is not available, rlogs should be parsed?

mpetkovic96 avatar Apr 02 '24 09:04 mpetkovic96

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

github-actions[bot] avatar Apr 02 '24 09:04 github-actions[bot]

@jnewb1 Could you check if there is any potential to continue?

mpetkovic96 avatar Apr 02 '24 09:04 mpetkovic96

@jnewb1 ideally these shouldn't be hard coded. instead can we create a mock http server (example here: https://github.com/commaai/openpilot/blob/master/tools/lib/tests/test_caching.py#L15-L31)

@jnewb1 mock http server is created based on the example and changed hard coded url from the test

mpetkovic96 avatar Apr 03 '24 12:04 mpetkovic96

This PR has had no activity for 30 days. It will be automatically closed in 7 days if there is no activity.

github-actions[bot] avatar May 09 '24 01:05 github-actions[bot]