[run_test.sh] add maxfail option and improve help information#2013
Merged
yxieca merged 4 commits intosonic-net:masterfrom Aug 3, 2020
Merged
[run_test.sh] add maxfail option and improve help information#2013yxieca merged 4 commits intosonic-net:masterfrom
yxieca merged 4 commits intosonic-net:masterfrom
Conversation
- Allow setting maxfail for the test. - With individual method, if maxfail is set, any failure in a test module will cause test to end. - Explicit about options with parameter. Signed-off-by: Ying Xie <[email protected]>
daall
reviewed
Aug 2, 2020
tests/run_tests.sh
Outdated
| echo " -n : specify testbed name (*)" | ||
| echo " -c <testcases> : specify test cases to execute (default: none, executed all matched)" | ||
| echo " -d <dut name> : specify DUT name (*)" | ||
| echo " -e <paramters> : specify extra parameter(s) (default: none)" |
Contributor
There was a problem hiding this comment.
Suggested change
| echo " -e <paramters> : specify extra parameter(s) (default: none)" | |
| echo " -e <parameters> : specify extra parameter(s) (default: none)" |
tests/run_tests.sh
Outdated
Comment on lines
+13
to
+14
| echo " -k <log level> : specify file log level: error|warning|info|debug (default debug)" | ||
| echo " -l <log level> : specify cli log level: error|warning|info|debug (default warning)" |
Contributor
There was a problem hiding this comment.
Should we mention log vs. cli log level in the tag so it's more clear which is which at a glance?
Collaborator
Author
There was a problem hiding this comment.
Thanks! Fixed. didn't use full wording so that I don't have to move ':' indentation.
| fi | ||
|
|
||
| PYTEST_UTIL_OPTS=${PYTEST_COMMON_OPTS} | ||
| # Max failure only applicable to the test session. Not the preparation and cleanup session. |
Contributor
There was a problem hiding this comment.
@lguohan I can't remember off the top of my head - would a failure in announce_routes or neighbor_health trigger a failure in the old/current PR tests?
Collaborator
Author
There was a problem hiding this comment.
This is a minor detail we can come back to later. I'll merge this PR so that you can work on your next change.
lguohan
approved these changes
Aug 2, 2020
Collaborator
Author
|
retest vsimage please |
1 similar comment
Collaborator
Author
|
retest vsimage please |
kazinator-arista
pushed a commit
to kazinator-arista/sonic-mgmt
that referenced
this pull request
Mar 4, 2026
includes: 320591a [DualToR] Handle race condition between tunnel_decap and mux orchestrator (sonic-net#2114) 5027a8f Handling Invalid CRM configuration gracefully (sonic-net#2109) 0b120fa [ci]: use native arm64 and armhf pool (sonic-net#2013) 394e88a Don't handle buffer pool watermark during warm reboot reconciling (sonic-net#1987) 9008a01 patch for issue sonic-net#1971 - enable Rx Drop handling for cisco-8000 (sonic-net#2041) 2723ee3 create debug_shell_enable config to enable debug shell (sonic-net#2060) d7be0b9 [request parser] Add unit tests for request parser for multiple values (sonic-net#1766)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Fixes # (issue)
Type of change
Approach
What is the motivation for this PR?
PR test behavior changed after switching over to use run_tests.sh. It is no longer stop at first failure and causing longer run time for failed tests.
How did you do it?
module will cause test to end.
Signed-off-by: Ying Xie [email protected]
How did you verify/test it?
Don't specify -q 1 option:
yinxi@acs-trusty8:/var/src/sonic-mgmt/tests$ ./run_tests.sh -d str-dx010-acs-1 -n vms3-t1-dx010-1 -i /var/src/sonic-mgmt/ansible/str,/var/src/sonic-mgmt/ansible/veos -u -m group -p /tmp/logs-01 -c copp/test_copp.py
=== Running tests in groups ===
copp/test_copp.py::TestCOPP::test_policer[ARP]
------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------
19:53:09 WARNING recover.py:recover:92: Try to recover str-dx010-acs-1 using method adaptive
19:53:09 WARNING recover.py:adaptive_recover:80: Restoring {'check_item': 'processes', 'failed': True, 'services_status': {'lldp': True, 'bgp': True, 'pmon': True, 'database': True, 'teamd': True, 'swss': False, 'syncd': True, 'snmp': True}, 'processes_status': {'lldp': {'status': True, 'exited_critical_process': [], 'running_critical_process': [u'lldp-syncd', u'lldpd', u'lldpmgrd']}, 'pmon': {'status': True, 'exited_critical_process': [], 'running_critical_process': [u'psud', u'xcvrd']}, 'database': {'status': True, 'exited_critical_process': [], 'running_critical_process': [u'redis']}, 'snmp': {'status': True, 'exited_critical_process': [], 'running_critical_process': [u'snmp-subagent', u'snmpd']}, 'bgp': {'status': True, 'exited_critical_process': [], 'running_critical_process': [u'bgpcfgd', u'bgpd', u'fpmsyncd', u'staticd', u'zebra']}, 'teamd': {'status': True, 'exited_critical_process': [], 'running_critical_process': [u'teammgrd', u'teamsyncd']}, 'syncd': {'status': True, 'exited_critical_process': [], 'running_critical_process': [u'syncd']}, 'swss': {'status': False, 'exited_critical_process': [u'orchagent'], 'running_critical_process': [u'buffermgrd', u'intfmgrd', u'nbrmgrd', u'neighsyncd', u'portmgrd', u'portsyncd', u'vlanmgrd', u'vrfmgrd', u'vxlanmgrd']}}} with proposed action: config_reload, final action: config_reload
Loading callback plugin json of type stdout, v2.0 from /usr/local/lib/python2.7/dist-packages/ansible/plugins/callback/json.pyc
Loading callback plugin json of type stdout, v2.0 from /usr/local/lib/python2.7/dist-packages/ansible/plugins/callback/json.pyc
FAILED [ 11%]
copp/test_copp.py::TestCOPP::test_policer[IP2ME] PASSED [ 22%]
copp/test_copp.py::TestCOPP::test_policer[SNMP] PASSED [ 33%]
copp/test_copp.py::TestCOPP::test_policer[SSH] PASSED [ 44%]
copp/test_copp.py::TestCOPP::test_no_policer[BGP] PASSED [ 55%]
copp/test_copp.py::TestCOPP::test_no_policer[DHCP] PASSED [ 66%]
copp/test_copp.py::TestCOPP::test_no_policer[LACP] PASSED [ 77%]
copp/test_copp.py::TestCOPP::test_no_policer[LLDP] PASSED [ 88%]
copp/test_copp.py::TestCOPP::test_no_policer[UDLD] PASSED [100%]
======================================================================================== FAILURES ========================================================================================
=================================================================== 1 failed, 8 passed, 3 warnings in 1154.50 seconds ====================================================================
Specify -q 1 option:
yinxi@acs-trusty8:/var/src/sonic-mgmt/tests$ ./run_tests.sh -d str-dx010-acs-1 -n vms3-t1-dx010-1 -i /var/src/sonic-mgmt/ansible/str,/var/src/sonic-mgmt/ansible/veos -u -m group -p /tmp/logs-01 -c copp/test_copp.py -e -x
=== Running tests in groups ===
================================================================================== test session starts ===================================================================================
platform linux2 -- Python 2.7.12, pytest-4.6.5, py-1.8.1, pluggy-0.13.1
ansible: 2.8.7
rootdir: /var/src/sonic-mgmt/tests, inifile: pytest.ini
plugins: ansible-2.2.2, xdist-1.28.0, forked-1.1.3, repeat-0.8.0
collected 9 items
copp/test_copp.py::TestCOPP::test_policer[ARP] Loading callback plugin json of type stdout, v2.0 from /usr/local/lib/python2.7/dist-packages/ansible/plugins/callback/json.pyc
Loading callback plugin json of type stdout, v2.0 from /usr/local/lib/python2.7/dist-packages/ansible/plugins/callback/json.pyc
FAILED [ 11%]
======================================================================================== FAILURES ========================================================================================
========================================================================= 1 failed, 3 warnings in 453.74 seconds =========================================================================