Skip to content

Use conditional mark to skip testcase instead of required_mocked_dualtor#6766

Merged
xwjiang-ms merged 5 commits intosonic-net:masterfrom
xwjiang-ms:change_mock_skip_to_conditional_mark
Nov 10, 2022
Merged

Use conditional mark to skip testcase instead of required_mocked_dualtor#6766
xwjiang-ms merged 5 commits intosonic-net:masterfrom
xwjiang-ms:change_mock_skip_to_conditional_mark

Conversation

@xwjiang-ms
Copy link
Contributor

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?

Currently, we use required_mocked_dualtor to skip testcases in real dualtor under tests/dualtor/, but it's not efficient enough, and will cause show mux status error after toggle.

How did you do it?

Use conditional mark to skip testcase instead of required mocked dualtor

How did you verify/test it?

Run tests

Any platform specific information?

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

Documentation

What is the motivation for this PR?
Currently, we use required_mocked_dualtor to skip testcases in real
dualtor under `tests/dualtor/`, but it's not efficient enough, and will cause show mux
status error after toggle.

How did you do it?
Use conditional mark to skip testcase instead of required mocked dualtor

How did you verify/test it?
Run tests

Any platform specific information?
Supported testbed topology if it's a new test case?
@azure-pipelines
Copy link

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...............................................................Failed
- hook id: check-yaml
- exit code: 1

while constructing a mapping
in "tests/common/plugins/conditional_mark/tests_mark_conditions.yaml", line 827, column 3
found duplicate key "skip" with value "{}" (original value: "{}")
in "tests/common/plugins/conditional_mark/tests_mark_conditions.yaml", line 831, column 3

To suppress this check see:
http://yaml.readthedocs.io/en/latest/api.html#duplicate-keys

check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1
...
[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>

@lgtm-com
Copy link

lgtm-com bot commented Nov 8, 2022

This pull request introduces 1 alert when merging 48c18cb into a4feb41 - view on LGTM.com

new alerts:

  • 1 for Unused import

@azure-pipelines
Copy link

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...............................................................Failed
- hook id: check-yaml
- exit code: 1

while constructing a mapping
in "tests/common/plugins/conditional_mark/tests_mark_conditions.yaml", line 827, column 3
found duplicate key "skip" with value "{}" (original value: "{}")
in "tests/common/plugins/conditional_mark/tests_mark_conditions.yaml", line 831, column 3

To suppress this check see:
http://yaml.readthedocs.io/en/latest/api.html#duplicate-keys

check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1
...
[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
Copy link

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...............................................................Failed
- hook id: check-yaml
- exit code: 1

while constructing a mapping
in "tests/common/plugins/conditional_mark/tests_mark_conditions.yaml", line 827, column 3
found duplicate key "skip" with value "{}" (original value: "{}")
in "tests/common/plugins/conditional_mark/tests_mark_conditions.yaml", line 831, column 3

To suppress this check see:
http://yaml.readthedocs.io/en/latest/api.html#duplicate-keys

check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1
...
[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>

@ZhaohuiS
Copy link
Contributor

ZhaohuiS commented Nov 8, 2022

@xwjiang-ms Since your PR covered the same issue in my PR #6768 , I will close mine.

ZhaohuiS
ZhaohuiS previously approved these changes Nov 8, 2022
Copy link
Contributor

@ZhaohuiS ZhaohuiS left a comment

Choose a reason for hiding this comment

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

LGTM

@azure-pipelines
Copy link

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...............................................................Failed
- hook id: check-yaml
- exit code: 1

while constructing a mapping
in "tests/common/plugins/conditional_mark/tests_mark_conditions.yaml", line 833, column 3
found duplicate key "skip" with value "{}" (original value: "{}")
in "tests/common/plugins/conditional_mark/tests_mark_conditions.yaml", line 837, column 3

To suppress this check see:
http://yaml.readthedocs.io/en/latest/api.html#duplicate-keys

check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1
...
[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>

@xwjiang-ms xwjiang-ms requested a review from ZhaohuiS November 9, 2022 05:44
@azure-pipelines
Copy link

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...............................................................Failed
- hook id: check-yaml
- exit code: 1

while constructing a mapping
in "tests/common/plugins/conditional_mark/tests_mark_conditions.yaml", line 833, column 3
found duplicate key "skip" with value "{}" (original value: "{}")
in "tests/common/plugins/conditional_mark/tests_mark_conditions.yaml", line 837, column 3

To suppress this check see:
http://yaml.readthedocs.io/en/latest/api.html#duplicate-keys

check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1
...
[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>

Copy link
Contributor

@ZhaohuiS ZhaohuiS left a comment

Choose a reason for hiding this comment

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

LGTM

@xwjiang-ms xwjiang-ms merged commit 9eb6e06 into sonic-net:master Nov 10, 2022
@xwjiang-ms xwjiang-ms deleted the change_mock_skip_to_conditional_mark branch November 10, 2022 01:01
wangxin pushed a commit that referenced this pull request Nov 23, 2022
…tor (#6766)

* Use conditional mark to skip testcase instead of required mocked dualtor

What is the motivation for this PR?
Currently, we use required_mocked_dualtor to skip testcases in real
dualtor under `tests/dualtor/`, but it's not efficient enough, and will cause show mux
status error after toggle.

How did you do it?
Use conditional mark to skip testcase instead of required mocked dualtor

How did you verify/test it?
Run tests

Any platform specific information?
Supported testbed topology if it's a new test case?
wangxin pushed a commit that referenced this pull request Nov 23, 2022
…tor (#6766)

* Use conditional mark to skip testcase instead of required mocked dualtor

What is the motivation for this PR?
Currently, we use required_mocked_dualtor to skip testcases in real
dualtor under `tests/dualtor/`, but it's not efficient enough, and will cause show mux
status error after toggle.

How did you do it?
Use conditional mark to skip testcase instead of required mocked dualtor

How did you verify/test it?
Run tests

Any platform specific information?
Supported testbed topology if it's a new test case?
bingwang-ms pushed a commit to bingwang-ms/sonic-mgmt that referenced this pull request Jul 27, 2023
…ic-mgmt into internal-202205

Fix merge conflicts.

- Fix verify_no_packet_any call in fib_test (sonic-net#6461)
- Fix the test case test_TSA failure when check the routes on the eos host (sonic-net#6483)
- Use conditional mark to skip testcase instead of required_mocked_dualtor (sonic-net#6766)
- [tagged_arp] fix issue 'fixture ports_list not found' (sonic-net#6773)
- [QoS] fixes after moving to python3 (sonic-net#6786)
- update parse funciton for image url (sonic-net#6848)
- Fix typo in get_queue_counter (sonic-net#6852)
- Revert "Fix loganalyzer.py UnicodeDecodeError (sonic-net#6524)" (sonic-net#6858)
- Enhancing core_dump_and_config_check to be multi-asic aware (sonic-net#6527)
- Adding support for calculating balancing in multi-lc/multi-asic case (Test_fib.py) (sonic-net#6391)
- Support different RC in case of pre or post sanity check failed (sonic-net#6860)
- Update getbuild.py to support pass an empty access_token
- [202205] Fixing auto_techsupport (sonic-net#6882)
- Merge branch 'azure-202205' into dev/yaqiangzhu/202205_manually_merge
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.

3 participants