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

safety: coverage report #1696

Merged
merged 28 commits into from
Oct 26, 2023
Merged

safety: coverage report #1696

merged 28 commits into from
Oct 26, 2023

Conversation

sshane
Copy link
Contributor

@sshane sshane commented Oct 24, 2023

A lot is already hit because of tests like test_spam_can_buses and test_tx_hook_on_wrong_safety_mode

image


One legitamate catch is this address we don't test for relay malfunctions because the tests only support one (#1545):

image

But it's mostly defaults:

image

@sshane
Copy link
Contributor Author

sshane commented Oct 24, 2023

This also doesn't catch #1695 because we have a test that checks that the driver torque meas struct is reset, it just doesn't check the actual values, which I'm adding a generic test for in that PR.

@sshane sshane added the tests label Oct 24, 2023
@adeebshihadeh
Copy link
Contributor

adeebshihadeh commented Oct 24, 2023

Nice! This isn't expected to catch everything; it's just a minimum bar and sanity check for our unit test coverage. I want to merge this, fix any missing coverage, then make CI fail if coverage is <100%.

@sshane
Copy link
Contributor Author

sshane commented Oct 25, 2023

Example output on safety related files:

Looks like we need, but will do in follow up PR:

  • body tests
  • ELM tests
  • alloutput, nooutput tests
Overall coverage rate:
  lines......: 85.3% (1926 of 2258 lines)
  functions..: 75.0% (165 of 220 functions)
Some files have less than 100% coverage:
File '/home/batman/openpilot/panda/board/safety/safety_body.h' Lines executed:0.00% of 17
File '/home/batman/openpilot/panda/board/safety/safety_elm327.h' Lines executed:0.00% of 20
File '/home/batman/openpilot/panda/board/safety/safety_volkswagen_pq.h' Lines executed:99.03% of 103
File '/home/batman/openpilot/panda/board/safety/safety_volkswagen_mqb.h' Lines executed:98.41% of 126
File '/home/batman/openpilot/panda/board/safety/safety_hyundai.h' Lines executed:98.63% of 146
File '/home/batman/openpilot/panda/board/safety/safety_hyundai_common.h' Lines executed:95.74% of 47
File '/home/batman/openpilot/panda/board/safety/safety_ford.h' Lines executed:98.05% of 154
File '/home/batman/openpilot/panda/board/safety/safety_gm.h' Lines executed:98.92% of 93
File '/home/batman/openpilot/panda/board/safety/safety_honda.h' Lines executed:96.83% of 189
File '/home/batman/openpilot/panda/board/safety/safety_defaults.h' Lines executed:0.00% of 26

@sshane sshane requested a review from adeebshihadeh October 25, 2023 01:08
@sshane sshane merged commit da66779 into master Oct 26, 2023
@sshane sshane deleted the safety-cov branch October 26, 2023 05:01
@sshane sshane mentioned this pull request Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants