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

Support smartswitch in get_testbed_type and announce_routes #16536

Merged
merged 3 commits into from
Jan 16, 2025

Conversation

bingwang-ms
Copy link
Collaborator

Description of PR

Summary:
This PR is to support smartswitch in get_testbed_type.
Before this change, the WARNING message shows up in each run.
image

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405
  • 202411

Approach

What is the motivation for this PR?

This PR is to support smartswitch in get_testbed_type.

How did you do it?

Update the regex in get_testbed_type to include `smartswitch.

How did you verify/test it?

Verified by manually run a test. The warning message doesn't show up any more.

Any platform specific information?

No.

Supported testbed topology if it's a new test case?

Not a new test.

Documentation

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@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.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Failed
- hook id: check-ast
- exit code: 1

tests/common/testbed.py: failed parsing with CPython 3.10.12:

Traceback (most recent call last):
File "/home/AzDevOps/.cache/pre-commit/repo9dckhwpp/py_env-python3/lib/python3.10/site-packages/pre_commit_hooks/check_ast.py", line 21, in main
ast.parse(f.read(), filename=filename)
File "/usr/lib/python3.10/ast.py", line 50, in parse
return compile(source, filename, mode, flags,
File "tests/common/testbed.py", line 258
<<<<<<< Updated upstream
IndentationError: expected an indented block after function definition on line 257

flake8...................................................................Failed
...
[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>

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@bingwang-ms bingwang-ms changed the title Support smartswitch in get_testbed_type Support smartswitch in get_testbed_type and announce_routes Jan 15, 2025
Copy link
Contributor

@prabhataravind prabhataravind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@bingwang-ms bingwang-ms merged commit ca45dda into master Jan 16, 2025
19 checks passed
@mssonicbld
Copy link
Collaborator

@bingwang-ms PR conflicts with 202405 branch

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Jan 16, 2025
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202411: #16561

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