-
Notifications
You must be signed in to change notification settings - Fork 163
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
[psud] Increase unit test coverage; Refactor mock platform #154
Conversation
This comment has been minimized.
This comment has been minimized.
@mprabhu-nokia: I have done a bit more refactoring to psud in order to increase unit test coverage. Can you please test and review these changes on a modular chassis? Update: Please wait on testing and reviewing these changes until the sonic-platform-common PR merges and I get the check builds passing. I will notify you again at that point. |
This comment has been minimized.
This comment has been minimized.
Unit test is failing due to a bug uncovered in sonic_platform_base. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@mprabhu-nokia: Can you please review and test this PR? |
1 similar comment
@mprabhu-nokia: Can you please review and test this PR? |
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.
Looks good.
Unit tests for psud depend on sonic-platform-common as of sonic-net/sonic-platform-daemons#154
Unit tests for psud depend on sonic-platform-common as of sonic-net/sonic-platform-daemons#154
Unit tests for psud depend on sonic-platform-common as of sonic-net/sonic-platform-daemons#154
Unit tests for psud depend on sonic-platform-common as of sonic-net/sonic-platform-daemons#154
When build python3 xcvrd, it tries to do basic check which will import this y_cable.py. However, not all platform supports python3 API now, so it could cause an issue when importing sonic_platform.platform We skip the ImportError here to make the builder happy. And this is safe because: - If any python package is not available, there will be exception when use it - Vendors know their platform API version, they are responsible to use correct python version when importing this file.
Description
run()
method does not contain an infinite loop, thus allowing us to unit test itPSUD_UNIT_TESTING
environment variable in daemon codePrevious unit test coverage:
Unit test coverage with this patch:
Motivation and Context
To increase unit test coverage >= 90% in order to prevent regressions
How Has This Been Tested?
The refactored psud has been tested on a physical DUT and the unit test results can be examined via the Azure Pipelines check builds in this PR.