Skip to content

Commit

Permalink
feat: add parallel modes file to pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
cyw233 committed Nov 24, 2024
1 parent 6632635 commit f3204f6
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .azure-pipelines/run-test-elastictest-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ parameters:
type: string
default: ""

- name: PARALLEL_MODES_FILE
type: string
default: "default.json"

# 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 @@ -263,6 +267,7 @@ steps:
--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 }} \
--retry-cases-include ${{ parameters.RETRY_CASES_INCLUDE }} \
--retry-cases-exclude ${{ parameters.RETRY_CASES_EXCLUDE }} \
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 @@ -286,6 +286,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 @@ -835,6 +836,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 @@ -1058,6 +1069,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"
}

0 comments on commit f3204f6

Please sign in to comment.