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

[syseepromd] Add unit tests; Refactor to allow for greater unit test coverage #156

Merged
merged 14 commits into from
Apr 8, 2021
Merged

[syseepromd] Add unit tests; Refactor to allow for greater unit test coverage #156

merged 14 commits into from
Apr 8, 2021

Conversation

jleveque
Copy link
Contributor

@jleveque jleveque commented Feb 22, 2021

Description

  • Refactor syseepromd to eliminate infinite loops to allow for increased unit test coverage
  • Refactor signal handler and ensure daemon always exits with non-zero exit code so that supervisor will restart it
  • Add unit tests

Unit test coverage increases from 0% to 90%:

----------- coverage: platform linux, python 3.7.3-final-0 -----------
Name                 Stmts   Miss  Cover
----------------------------------------
scripts/syseepromd      97     10    90%

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.

@lgtm-com

This comment has been minimized.

@lgtm-com

This comment has been minimized.

@lgtm-com

This comment has been minimized.

@jleveque jleveque changed the title [syseepromd] Refactor to no longer fall back to old plugins; Add unit tests [syseepromd] Add unit tests; Refactor to allow for greater unit test coverage Feb 23, 2021
@jleveque jleveque marked this pull request as ready for review February 23, 2021 22:12
@jleveque jleveque requested review from keboliu and lguohan February 23, 2021 22:12
@jleveque jleveque merged commit 5b6d9c0 into sonic-net:master Apr 8, 2021
@jleveque jleveque deleted the syseepromd_add_unit_tests branch April 8, 2021 18:26
lguohan pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Apr 9, 2021
Unit tests for syseepromd depend on sonic-platform-common as of sonic-net/sonic-platform-daemons#156
lguohan pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Apr 10, 2021
Unit tests for syseepromd depend on sonic-platform-common as of sonic-net/sonic-platform-daemons#156
raphaelt-nvidia pushed a commit to raphaelt-nvidia/sonic-buildimage that referenced this pull request May 23, 2021
carl-nokia pushed a commit to carl-nokia/sonic-buildimage that referenced this pull request Aug 7, 2021
vdahiya12 pushed a commit to vdahiya12/sonic-platform-daemons that referenced this pull request Apr 4, 2022
Change sffbase.py code to make it compatible with python3

1. change iteritems to items
2. change type(*) = types.* to type(*) = $typename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants