-
Notifications
You must be signed in to change notification settings - Fork 51
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
update the search pattern for CAN device (BugFix) #849
update the search pattern for CAN device (BugFix) #849
Conversation
Update the search pattern for CAN device and adding unittest
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #849 +/- ##
==========================================
+ Coverage 35.38% 35.39% +0.01%
==========================================
Files 303 303
Lines 34240 34240
Branches 5917 5917
==========================================
+ Hits 12115 12119 +4
+ Misses 21559 21558 -1
+ Partials 566 563 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
/canonical/self-hosted-runners/run-workflows 00873f7 |
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.
Thanks for this PR!
There are already unit tests for the udevadm parser, they are located in checkbox-support/checkbox_support/parsers/tests/test_udevadm.py
(with sample data hosted in checkbox-support/checkbox_support/parsers/tests/udevadm_data
).
Is there a reason why you separated your tests and put them at a different location?
I recommend you add the outcome of your own DUT in the udevadm_data
, and add your tests to test_udevadm.py
. You can look at how tests have been implemented there and use similar methods.
For your information, there are already a few sample data files that have a Canbus device: ZCU104.txt
and CARA_T_SOCKETCAN.txt
. You can leverage these when you write your tests to make sure your changes don't impact existing data.
fixed the unit tests for the CAN device in NXP S32G
@pieqq I just sent a new commits for those suggestion you came up. Please review this PR again, thanks. |
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.
One question about the regex being used below.
Also, since both CARA_T_SOCKETCAN.txt
and ZCU104.txt
have a socketcan device, could you add a check in their respective unit tests? This will help with regression testing.
updated the search pattern
/canonical/self-hosted-runners/run-workflows db8ec4e |
Thanks for the changes! I added a check for socketcan devices in the ZCU104 unit test, so we're good to go! |
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.
LGTM +1
Just learnt from here that we can run a single unit test, nice!
* Fix: update the search pattern for CAN device Update the search pattern for CAN device and adding unittest * Fix: fixed unit test for NXP S32G fixed the unit tests for the CAN device in NXP S32G * Fix: updated the search pattern updated the search pattern * Add check for socketcan in udevadm parser unit test for ZCU --------- Co-authored-by: Pierre Equoy <[email protected]>
* Fix: update the search pattern for CAN device Update the search pattern for CAN device and adding unittest * Fix: fixed unit test for NXP S32G fixed the unit tests for the CAN device in NXP S32G * Fix: updated the search pattern updated the search pattern * Add check for socketcan in udevadm parser unit test for ZCU --------- Co-authored-by: Pierre Equoy <[email protected]>
* Fix: update the search pattern for CAN device Update the search pattern for CAN device and adding unittest * Fix: fixed unit test for NXP S32G fixed the unit tests for the CAN device in NXP S32G * Fix: updated the search pattern updated the search pattern * Add check for socketcan in udevadm parser unit test for ZCU --------- Co-authored-by: Pierre Equoy <[email protected]>
BugFix: Fixed the udevadm parser for CAN devices
Modify the search pattern for CAN devices, including new llcecan device, and adding unit tests
Description
There are two kind of CAN devices on NXP S32G development board, one is generic CAN device named as canxxxx, another one is can devices from Low Latency Communication Engine (LLCE) and named as llcecanxxxx.
The current implementation for CAN devices in udevadm parser is the device name should starts with 'can' string.
So I have modified the search pattern for CAN devices, including new llcecan device, and adding unit tests.
I also applied this patch to the checkbox to ensure checkbox could identified both generic CAN device and LLCE CAN devices on NXP S32G development board.
Resolved issues
N/A
Documentation
N/A
Tests
stanley@stanley-ThinkPad-T490:~/Desktop/Git_Repos/checkbox-2023$ PYTHONPATH=checkbox-support/:$PYTHONAPATH python3 -m unittest -vv checkbox-support/checkbox_support/parsers/tests/test_udevadm.py
-k test_NXP_S32G_SOCKETCAN
test_NXP_S32G_SOCKETCAN (checkbox-support.checkbox_support.parsers.tests.test_udevadm.TestUdevadmParser) ... ok
Ran 1 test in 0.079s
OK
C3 submission with side-load checkbox:
https://certification.canonical.com/hardware/202304-31451/submission/349081/test-results/pass/