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

[action] [PR:15719] feat: add parallel modes file to pipeline #16317

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .azure-pipelines/run-test-elastictest-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,18 @@ parameters:
type: string
default: ""

# Enable parallel run for test cases that support parallel run
- name: ENABLE_PARALLEL_RUN
type: string
default: ""

# Specify the file that contains the parallel mode for test cases that need to run in parallel when
# ENABLE_PARALLEL_RUN is set to True. Default value is the test_parallel_modes/default.json file in this repo.
# This field will be ignored if ENABLE_PARALLEL_RUN is set to False.
- name: PARALLEL_MODES_FILE
type: string
default: ""

# The number of retries when the script fails. Global retry if retry_cases_include and retry_cases_exclude are both empty, otherwise specific retry
- name: RETRY_TIMES
type: string
Expand Down Expand Up @@ -264,6 +272,8 @@ steps:
--repo-name ${{ parameters.REPO_NAME }} \
--mgmt-branch ${{ parameters.MGMT_BRANCH }} \
--stop-on-failure ${{ parameters.STOP_ON_FAILURE }} \
--enable-parallel-run ${{ parameters.ENABLE_PARALLEL_RUN }} \
--parallel-modes-file ${{ parameters.PARALLEL_MODES_FILE }} \
--retry-times ${{ parameters.RETRY_TIMES }} \
--requester "${{ parameters.REQUESTER }}" \
--max-execute-seconds $((${{ parameters.MAX_RUN_TEST_MINUTES }} * 60)) \
Expand Down
12 changes: 12 additions & 0 deletions .azure-pipelines/test_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ def create(self, topology, test_plan_name="my_test_plan", deploy_mg_extra_params
"test_option": {
"stop_on_failure": kwargs.get("stop_on_failure", True),
"enable_parallel_run": kwargs.get("enable_parallel_run", False),
"parallel_modes_file": kwargs.get("parallel_modes_file", "default.json"),
"retry_times": kwargs.get("retry_times", 2),
"retry_cases_include": retry_cases_include,
"retry_cases_exclude": retry_cases_exclude,
Expand Down Expand Up @@ -831,6 +832,16 @@ def poll(self, test_plan_id, interval=60, timeout=-1, expected_state="", expecte
choices=[True, False],
help="Enable parallel run or not."
)
parser_create.add_argument(
"--parallel-modes-file",
type=str,
dest="parallel_modes_file",
nargs='?',
const='default.json',
default='default.json',
required=False,
help="Which parallel modes file to use when parallel run is enabled."
)
parser_create.add_argument(
"--retry-times",
type=int,
Expand Down Expand Up @@ -1034,6 +1045,7 @@ def poll(self, test_plan_id, interval=60, timeout=-1, expected_state="", expecte
platform=args.platform,
stop_on_failure=args.stop_on_failure,
enable_parallel_run=args.enable_parallel_run,
parallel_modes_file=args.parallel_modes_file,
retry_times=args.retry_times,
retry_cases_include=args.retry_cases_include,
retry_cases_exclude=args.retry_cases_exclude,
Expand Down
31 changes: 31 additions & 0 deletions tests/test_parallel_modes/cisco_t2_8800.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"arp/test_neighbor_mac_noptf.py": "FULL_PARALLEL",
"autorestart/test_container_autorestart.py": "RP_FIRST",
"bgp/test_bgp_fact.py": "FULL_PARALLEL",
"bgp/test_bgp_session_flap.py": "FULL_PARALLEL",
"container_checker/test_container_checker.py": "RP_FIRST",
"crm/test_crm.py": "FULL_PARALLEL",
"iface_namingmode/test_iface_namingmode.py": "FULL_PARALLEL",
"lldp/test_lldp.py": "FULL_PARALLEL",
"memory_checker/test_memory_checker.py": "FULL_PARALLEL",
"override_config_table/test_override_config_table_masic.py": "FULL_PARALLEL",
"passw_hardening/test_passw_hardening.py": "FULL_PARALLEL",
"pc/test_po_cleanup.py": "FULL_PARALLEL",
"platform_tests/api/test_chassis.py": "FULL_PARALLEL",
"platform_tests/api/test_module.py": "FULL_PARALLEL",
"platform_tests/api/test_sfp.py": "FULL_PARALLEL",
"platform_tests/api/test_thermal.py": "FULL_PARALLEL",
"platform_tests/cli/test_show_chassis_module.py": "FULL_PARALLEL",
"platform_tests/link_flap/test_cont_link_flap.py": "FULL_PARALLEL",
"platform_tests/sfp/test_sfputil.py": "FULL_PARALLEL",
"platform_tests/test_memory_exhaustion.py": "RP_FIRST",
"platform_tests/test_reboot.py": "RP_FIRST",
"platform_tests/test_reload_config.py": "RP_FIRST",
"platform_tests/test_sequential_restart.py": "FULL_PARALLEL",
"show_techsupport/test_techsupport.py": "FULL_PARALLEL",
"show_techsupport/test_techsupport_no_secret.py": "FULL_PARALLEL",
"snmp/test_snmp_cpu.py": "FULL_PARALLEL",
"snmp/test_snmp_interfaces.py": "FULL_PARALLEL",
"snmp/test_snmp_link_local.py": "FULL_PARALLEL",
"snmp/test_snmp_queue.py": "RP_FIRST"
}
5 changes: 5 additions & 0 deletions tests/test_parallel_modes/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"bgp/test_bgp_fact.py": "FULL_PARALLEL",
"lldp/test_lldp.py": "FULL_PARALLEL",
"snmp/test_snmp_interfaces.py": "FULL_PARALLEL"
}
Loading