Skip to content

[Mellanox] Ignore checking ASIC/module temperature if thermal updater is there #11165

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

Conversation

Junchao-Mellanox
Copy link
Contributor

Why I did it

thermal updater is a thread which will update ASIC/module thermal sysfs nodes periodically. Currently, there is no way to stop thermal updater. So, there is no easy way to mock thermal sysfs value if thermal updater is there (thermal updater will always override mocked values).

Work item tracking
  • Microsoft ADO (number only):

How I did it

Ignore ASIC/module thermal mock test if thermal updater is present

How to verify it

Manual test
sonic-mgmt regression test

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305
  • 202311

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

… is there

Change-Id: I13ecc12308c546a23d845fb1f81d2f43b3d2fb15
@mssonicbld
Copy link
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results:
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing tests/platform_tests/mellanox/mellanox_thermal_control_test_helper.py

fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/platform_tests/mellanox/mellanox_thermal_control_test_helper.py:1041:73: W605 invalid escape sequence 'd'

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run
    the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt
    docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

@mssonicbld
Copy link
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results:
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing tests/platform_tests/mellanox/mellanox_thermal_control_test_helper.py

fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Passed
flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run
    the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt
    docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

@liat-grozovik liat-grozovik merged commit 6138ae4 into sonic-net:master Feb 12, 2024
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Mar 4, 2024
… is there (sonic-net#11165)

- Why I did it
thermal updater is a thread which will update ASIC/module thermal sysfs nodes periodically. Currently, there is no way to stop thermal updater. So, there is no easy way to mock thermal sysfs value if thermal updater is there (thermal updater will always override mocked values).

- How I did it
Ignore ASIC/module thermal mock test if thermal updater is present

- How to verify it
Manual test
sonic-mgmt regression test
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #11858

mssonicbld pushed a commit that referenced this pull request Mar 4, 2024
… is there (#11165)

- Why I did it
thermal updater is a thread which will update ASIC/module thermal sysfs nodes periodically. Currently, there is no way to stop thermal updater. So, there is no easy way to mock thermal sysfs value if thermal updater is there (thermal updater will always override mocked values).

- How I did it
Ignore ASIC/module thermal mock test if thermal updater is present

- How to verify it
Manual test
sonic-mgmt regression test
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.

5 participants