Skip to content

Fix import issue of tests/snappi_tests in python3#9232

Merged
wangxin merged 2 commits intosonic-net:masterfrom
wangxin:collect-only-python-version
Aug 3, 2023
Merged

Fix import issue of tests/snappi_tests in python3#9232
wangxin merged 2 commits intosonic-net:masterfrom
wangxin:collect-only-python-version

Conversation

@wangxin
Copy link
Collaborator

@wangxin wangxin commented Aug 2, 2023

Description of PR

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 201911
  • 202012
  • 202205

Approach

What is the motivation for this PR?

To support smooth python3 migration, we need to explicitly specify the python version to be used in each branch. For master branch, default python should be python3. Need to use python3 to run the collect-only check as well.

Because of the gap in collect-only check of PR testing, some import issues under tests/snappi_tests are not caught.

How did you do it?

  • Use "python3 -m pytest" instead of directly run "pytest" command to do collect-only check.
  • Fixed all the import issues of tests/snappi_tests in python3.

How did you verify/test it?

Any platform specific information?

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

Documentation

To support smooth python3 migration, we need to explicitly specify the python
version to be used in each branch. For master branch, default python should be python3.
Need to use python3 to run the collect-only check as well.

Signed-off-by: Xin Wang <xiwang5@microsoft.com>
wsycqyz
wsycqyz previously approved these changes Aug 2, 2023
Copy link
Contributor

@wsycqyz wsycqyz left a comment

Choose a reason for hiding this comment

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

LGTM

@wangxin wangxin changed the title Explicitly use python3 to run pytest for collect-only check Fix import issue of tests/snappi_tests in python3 Aug 2, 2023
Copy link
Collaborator

@yejianquan yejianquan left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@wsycqyz wsycqyz left a comment

Choose a reason for hiding this comment

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

LGTM

@wangxin wangxin merged commit a3c0642 into sonic-net:master Aug 3, 2023
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Aug 3, 2023
What is the motivation for this PR?
To support smooth python3 migration, we need to explicitly specify the python version to be used in each branch. For master branch, default python should be python3. Need to use python3 to run the collect-only check as well.
Because of the gap in collect-only check of PR testing, some import issues under tests/snappi_tests are not caught.

How did you do it?
* Use "python3 -m pytest" instead of directly run "pytest" command to do collect-only check.
* Fixed all the import issues of tests/snappi_tests in python3.

Signed-off-by: Xin Wang <xiwang5@microsoft.com>
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202305: #9246

mssonicbld pushed a commit that referenced this pull request Aug 3, 2023
What is the motivation for this PR?
To support smooth python3 migration, we need to explicitly specify the python version to be used in each branch. For master branch, default python should be python3. Need to use python3 to run the collect-only check as well.
Because of the gap in collect-only check of PR testing, some import issues under tests/snappi_tests are not caught.

How did you do it?
* Use "python3 -m pytest" instead of directly run "pytest" command to do collect-only check.
* Fixed all the import issues of tests/snappi_tests in python3.

Signed-off-by: Xin Wang <xiwang5@microsoft.com>
SuvarnaMeenakshi added a commit to SuvarnaMeenakshi/sonic-mgmt that referenced this pull request Aug 4, 2023
SuvarnaMeenakshi added a commit to SuvarnaMeenakshi/sonic-mgmt that referenced this pull request Aug 4, 2023
@wangxin wangxin deleted the collect-only-python-version branch August 7, 2023 04:49
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Jan 25, 2024
What is the motivation for this PR?
To support smooth python3 migration, we need to explicitly specify the python version to be used in each branch. For master branch, default python should be python3. Need to use python3 to run the collect-only check as well.
Because of the gap in collect-only check of PR testing, some import issues under tests/snappi_tests are not caught.

How did you do it?
* Use "python3 -m pytest" instead of directly run "pytest" command to do collect-only check.
* Fixed all the import issues of tests/snappi_tests in python3.

Signed-off-by: Xin Wang <xiwang5@microsoft.com>
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