Skip to content

Add test case supported topology to techsupport UT#7790

Merged
liuh-80 merged 1 commit intosonic-net:masterfrom
liuh-80:dev/liuh/fix-showtech-nightly
Mar 20, 2023
Merged

Add test case supported topology to techsupport UT#7790
liuh-80 merged 1 commit intosonic-net:masterfrom
liuh-80:dev/liuh/fix-showtech-nightly

Conversation

@liuh-80
Copy link
Contributor

@liuh-80 liuh-80 commented Mar 20, 2023

What I did
Add test case supported topology to techsupport UT.

Why I did it
Test case supported topology is missing in the UT, the techsupport UT are skipped in some test scenario.

To protect the patch, add this UT to check TACACS will send remote address to server.

How I verified it
Pass all UT.

Details if related

@liuh-80 liuh-80 requested a review from yxieca as a code owner March 20, 2023 06:23
@liuh-80 liuh-80 requested a review from ZhaohuiS March 20, 2023 06:23
@mssonicbld
Copy link
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The detected issues may be old or new. For new issues, please try to fix them.

For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame
author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!

Detailed pre-commit check results:
trim trailing whitespace.................................................Passed
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/show_techsupport/test_techsupport_no_secret.py:24:1: E302 expected 2 blank lines, found 1
tests/show_techsupport/test_techsupport_no_secret.py:39:1: E302 expected 2 blank lines, found 1
tests/show_techsupport/test_techsupport_no_secret.py:47:1: E302 expected 2 blank lines, found 1
tests/show_techsupport/test_techsupport_no_secret.py:72:22: E225 missing whitespace around operator
tests/show_techsupport/test_techsupport_no_secret.py:92:23: F523 '...'.format(...) has unused arguments at position(s): 2
tests/show_techsupport/test_techsupport_no_secret.py:92:121: E501 line too long (125 > 120 characters)
tests/show_techsupport/test_techsupport_no_secret.py:96:30: W605 invalid escape sequence 's'
tests/show_techsupport/test_techsupport_no_secret.py:96:49: W605 invalid escape sequence 's'
tests/show_techsupport/test_techsupport_no_secret.py:96:53: W605 invalid escape sequence 's'
tests/show_techsupport/test_techsupport_no_secret.py:96:121: E501 line too long (128 > 120 characters)
tests/show_techsupport/test_techsupport_no_secret.py:104:39: W605 invalid escape sequence '('
...
[truncated extra lines, please run pre-commit locally to view full check results]

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>

@liuh-80 liuh-80 merged commit 1e7c050 into sonic-net:master Mar 20, 2023
@liuh-80 liuh-80 deleted the dev/liuh/fix-showtech-nightly branch March 20, 2023 08:26
wangxin pushed a commit that referenced this pull request Mar 31, 2023
**What I did**
Add test case supported topology to techsupport UT.

**Why I did it**
Test case supported topology is missing in the UT, the techsupport UT are skipped in some test scenario.

To protect the patch, add this UT to check TACACS will send remote address to server.

**How I verified it**
Pass all UT.

**Details if related**
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.

4 participants