-
Notifications
You must be signed in to change notification settings - Fork 208
[thermalctld] Refactor to allow for greater unit test coverage; Add more unit tests #157
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
Merged
jleveque
merged 43 commits into
sonic-net:master
from
jleveque:increase_thermalctld_coverage
Mar 18, 2021
Merged
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
011b96b
[thermalctld] Refactor to allow for greater unit test coverage
b814e16
Increase pytest verbosity
126263c
Refactor unit tests to align with source
2156279
Add mocked swsscommon lib
5198692
Remove THERMALCTLD_UNIT_TESTING env var
7663fa0
Use pytest fixture for setup/teardown
082f3c0
Use call_count in favor of assert_called[_once]
53fea67
Fix test bug and check both instances to ensure class var is correct
a2df880
[mock_platform] inherit from sonic_platform_base
aca1580
Update mock_platform.py
e25363c
Tests use new setters
02bc7ab
Use parens instead of escaping newlines
b118e0e
Change 'absence' to 'absent', 'fault' to 'faulty' where applicable
13ddb52
Add tests for signal handler
c72e31e
import sys
04eb5ef
Add MockThermalManager class to mock_platform.py
f4a036a
Replace 'deinit()' methods with actual destructors
ff163a7
Replace 'takes' with 'took'
ba8069e
Use more modern method of initializing base class
8b480d5
Go back to deinitializer methods
487278f
become -> became
873827e
Add tests for ThermalControlDaemon.run() and main()
79151bf
Add test_temperupdater_deinit
4d5f6ea
Grammar tweaks, pluralize message dynamically
0321f2a
Temp test
b9ae023
Remove unnecessary periods from log messages to align all
2e8409f
Add test case for TemperatureStatus.set_temperature when temp is not …
dd14af4
Add TestFanStatus class and test_check_speed_value_available method
c4de3fc
Add test case for try_get()
720b8b8
Add TestFanUpdater class and test_deinit() method
5315205
Add test case for FanUpdater._refresh_fan_drawer_status
f019f50
Fix grammar, add details to log messages
4f5db27
Add test case for update_entity_info()
006cbc9
Add test_set_fan_led_exception
637822b
[ThermalMonitor] Break loop logic out into separate function for unit…
74447f7
Add TestThermalMonitor class and test_main() method
04f0838
[TestFanUpdater] Add PSU fan test
41a3996
Add TestTemperatureUpdater class and test_update_psu_thermals() metho…
89a797f
Remove 'repr()' around exception to make log message identical betwee…
1c2c631
Check for more log messages
a5af749
Add MockSfpBase class to mock_platform.py
8e28094
Add test_update_sfp_thermals
3104fdf
Switch back to printing 'repr(e)'
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| [pytest] | ||
| addopts = --cov=scripts --cov-report html --cov-report term --cov-report xml --junitxml=test-results.xml -v | ||
| addopts = --cov=scripts --cov-report html --cov-report term --cov-report xml --junitxml=test-results.xml -vv |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@jleveque this dependency is causing sonic-net/sonic-buildimage#7143 sonic-buildimage to fail.
Do we need to remove it or add something ?
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.
PR to add dependency in sonic-buildimage here