sonic-mgmt icon indicating copy to clipboard operation
sonic-mgmt copied to clipboard

Crm total routes change

Open CharudattaSChitale opened this issue 2 years ago • 3 comments

Increasing the routes added in test_crm.py script from 10 to 64.

CharudattaSChitale avatar Nov 01 '22 19:11 CharudattaSChitale

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/crm/test_crm.py:16:1: F401 'tests.common.fixtures.duthost_utils.disable_route_checker' imported but unused
tests/crm/test_crm.py:17:1: F401 'tests.common.fixtures.duthost_utils.disable_fdb_aging' imported but unused
tests/crm/test_crm.py:33:121: E501 line too long (211 > 120 characters)
tests/crm/test_crm.py:34:121: E501 line too long (211 > 120 characters)
tests/crm/test_crm.py:35:121: E501 line too long (216 > 120 characters)
tests/crm/test_crm.py:36:121: E501 line too long (213 > 120 characters)
tests/crm/test_crm.py:37:121: E501 line too long (216 > 120 characters)
tests/crm/test_crm.py:38:121: E501 line too long (212 > 120 characters)
tests/crm/test_crm.py:54:19: E225 missing whitespace around operator
tests/crm/test_crm.py:61:1: E302 expected 2 blank lines, found 1
tests/crm/test_crm.py:153:13: E128 continuation line under-indented for visual indent
...
[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>

azure-pipelines[bot] avatar Nov 01 '22 19:11 azure-pipelines[bot]

I have fixed the pre-commit issues related to my changes. Rest of the issues are for the pre-existing code.

CharudattaSChitale avatar Nov 04 '22 17:11 CharudattaSChitale

Please follow the SONiC PR guidance to add some more description info for the PR.

What is the motivation for this PR? How did you do it? How did you verify/test it?

kevinskwang avatar Nov 12 '22 04:11 kevinskwang

Please also remove the redundant space changes.

kevinskwang avatar Nov 14 '22 02:11 kevinskwang

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/crm/test_crm.py:16:1: F401 'tests.common.fixtures.duthost_utils.disable_route_checker' imported but unused
tests/crm/test_crm.py:17:1: F401 'tests.common.fixtures.duthost_utils.disable_fdb_aging' imported but unused
tests/crm/test_crm.py:33:121: E501 line too long (211 > 120 characters)
tests/crm/test_crm.py:34:121: E501 line too long (211 > 120 characters)
tests/crm/test_crm.py:35:121: E501 line too long (216 > 120 characters)
tests/crm/test_crm.py:36:121: E501 line too long (213 > 120 characters)
tests/crm/test_crm.py:37:121: E501 line too long (216 > 120 characters)
tests/crm/test_crm.py:38:121: E501 line too long (212 > 120 characters)
tests/crm/test_crm.py:154:13: E128 continuation line under-indented for visual indent
tests/crm/test_crm.py:170:5: F841 local variable 'base_dir' is assigned to but never used
tests/crm/test_crm.py:254:121: E501 line too long (130 > 120 characters)
...
[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>

azure-pipelines[bot] avatar Nov 22 '22 22:11 azure-pipelines[bot]

I have updated the PR description and also fixed some of the pre-commit issues related to redundant spaces.

CharudattaSChitale avatar Nov 22 '22 22:11 CharudattaSChitale

This pull request introduces 2 alerts and fixes 4 when merging 2126fc71423cf83f11ea1867a56e7d502ff45d64 into 84e9b6bee2bd31712b06574347c77e7667915b58 - view on LGTM.com

new alerts:

  • 2 for Unused local variable

fixed alerts:

  • 4 for Unused local variable

Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine :gear: that powers LGTM.com. For more information, please check out our post on the GitHub blog.

lgtm-com[bot] avatar Nov 22 '22 22:11 lgtm-com[bot]

Pre-commit errors are not because of my changes. Still, fixed few of the pre commit errors. Can you please approve this change?

CharudattaSChitale avatar Nov 29 '22 19:11 CharudattaSChitale

@CharudattaSChitale Now I understood the purpose of this PR, but please remove all the redundant spaces/lines, just keep the required changes aligned with your description.

kevinskwang avatar Dec 02 '22 02:12 kevinskwang

I have kept my changes and also fixed all the pre-commit errors in this file. Please approve this PR

CharudattaSChitale avatar Dec 21 '22 02:12 CharudattaSChitale

I have kept my changes and also fixed all the pre-commit errors in this file. Please approve this PR

I still can see lots of space/new lines. Could you remove that?

kevinskwang avatar Jan 03 '23 02:01 kevinskwang