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

Fix syslog test failure about fixture tbinfo #13821

Merged
merged 5 commits into from
Sep 2, 2024

Conversation

wumiaont
Copy link
Contributor

Description of PR

Syslog test failed for complaining about tbinfo usage as it's a fixture. Solution is to add tbinfo as fixture in the orch_logrotate_setup. Then referencing tbinfo will be the yield of tbinfo which is a dict

Type of change

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

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405

What is the motivation for this PR?

Fix the test failure for syslog test_logrotate.

How did you do it?

How did you verify/test it?

Tested on OC test bed and see test pass now.

Any platform specific information?

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

Documentation

@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.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/syslog/test_logrotate.py:261:121: E501 line too long (121 > 120 characters)

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

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>

@wumiaont wumiaont marked this pull request as ready for review July 25, 2024 19:18
@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.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing tests/telemetry/events/bgp_events.py

fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Passed
flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

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>

@abdosi abdosi requested a review from cyw233 July 31, 2024 17:59
Copy link
Contributor

@cyw233 cyw233 left a comment

Choose a reason for hiding this comment

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

LGTM! Added the request label for 202405

@rlhui
Copy link

rlhui commented Aug 21, 2024

@yejianquan would you be able to help approve/merge this? thanks.

@yejianquan
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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

@yejianquan yejianquan merged commit 8a8395a into sonic-net:master Sep 2, 2024
17 checks passed
@mssonicbld
Copy link
Collaborator

@wumiaont PR conflicts with 202405 branch

@yejianquan
Copy link
Collaborator

Hi @wumiaont , please raise a separate PR resolving the conflict to 202405 branch

@wumiaont
Copy link
Contributor Author

wumiaont commented Sep 3, 2024

Hi @wumiaont , please raise a separate PR resolving the conflict to 202405 branch

OK

eddieruan-alibaba pushed a commit to eddieruan-alibaba/sonic-mgmt that referenced this pull request Sep 4, 2024
Description of PR
Syslog test failed for complaining about tbinfo usage as it's a fixture. Solution is to add tbinfo as fixture in the orch_logrotate_setup. Then referencing tbinfo will be the yield of tbinfo which is a dict

What is the motivation for this PR?
Fix the test failure for syslog test_logrotate.

How did you do it?
How did you verify/test it?
Tested on OC test bed and see test pass now.

co-authorized by: [email protected]
augusdn pushed a commit to augusdn/sonic-mgmt that referenced this pull request Sep 12, 2024
Description of PR
Syslog test failed for complaining about tbinfo usage as it's a fixture. Solution is to add tbinfo as fixture in the orch_logrotate_setup. Then referencing tbinfo will be the yield of tbinfo which is a dict

What is the motivation for this PR?
Fix the test failure for syslog test_logrotate.

How did you do it?
How did you verify/test it?
Tested on OC test bed and see test pass now.

co-authorized by: [email protected]
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Sep 12, 2024
Description of PR
Syslog test failed for complaining about tbinfo usage as it's a fixture. Solution is to add tbinfo as fixture in the orch_logrotate_setup. Then referencing tbinfo will be the yield of tbinfo which is a dict

What is the motivation for this PR?
Fix the test failure for syslog test_logrotate.

How did you do it?
How did you verify/test it?
Tested on OC test bed and see test pass now.

co-authorized by: [email protected]
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #14547

augusdn pushed a commit to augusdn/sonic-mgmt that referenced this pull request Sep 12, 2024
Description of PR
Syslog test failed for complaining about tbinfo usage as it's a fixture. Solution is to add tbinfo as fixture in the orch_logrotate_setup. Then referencing tbinfo will be the yield of tbinfo which is a dict

What is the motivation for this PR?
Fix the test failure for syslog test_logrotate.

How did you do it?
How did you verify/test it?
Tested on OC test bed and see test pass now.

co-authorized by: [email protected]
mssonicbld pushed a commit that referenced this pull request Sep 12, 2024
Description of PR
Syslog test failed for complaining about tbinfo usage as it's a fixture. Solution is to add tbinfo as fixture in the orch_logrotate_setup. Then referencing tbinfo will be the yield of tbinfo which is a dict

What is the motivation for this PR?
Fix the test failure for syslog test_logrotate.

How did you do it?
How did you verify/test it?
Tested on OC test bed and see test pass now.

co-authorized by: [email protected]
hdwhdw pushed a commit to hdwhdw/sonic-mgmt that referenced this pull request Sep 20, 2024
Description of PR
Syslog test failed for complaining about tbinfo usage as it's a fixture. Solution is to add tbinfo as fixture in the orch_logrotate_setup. Then referencing tbinfo will be the yield of tbinfo which is a dict

What is the motivation for this PR?
Fix the test failure for syslog test_logrotate.

How did you do it?
How did you verify/test it?
Tested on OC test bed and see test pass now.

co-authorized by: [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants