Conversation
Co-authored-by: penglei0 <101799503+penglei0@users.noreply.github.com>
…ern to ITestSuite - Add resolve_receiver() and _default_client_server() helpers to ITestSuite base class - Add @register_test_suite decorator and load_test_suite_from_registry() - Add from_tool_dict() to all test suites (IperfTest, IperfBatsTest, RTTTest, PingTest, ScpTest, SSHPingTest, RegularTest) - Refactor all test suites to use resolve_receiver() and _default_client_server() - Replace load_test_tool() if/elif cascade with registry-based lookup - Add PROXY_PROTOCOLS constant for proxy protocol detection - Improve docstrings across all test suites Co-authored-by: penglei0 <101799503+penglei0@users.noreply.github.com>
…and integration Co-authored-by: penglei0 <101799503+penglei0@users.noreply.github.com>
Co-authored-by: penglei0 <101799503+penglei0@users.noreply.github.com>
Co-authored-by: penglei0 <101799503+penglei0@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR formalizes the ITestSuite extension contract by centralizing shared receiver-resolution/defaulting logic and replacing runner.load_test_tool()’s if/elif dispatch with a registry-based lookup, with accompanying documentation and unit tests.
Changes:
- Added shared helpers to
ITestSuite(PROXY_PROTOCOLS,resolve_receiver(),_default_client_server()) and introduced a test-suite registry + loader. - Refactored concrete test suites to register themselves and to construct configs via
from_tool_dict(). - Updated
runner.load_test_tool()to delegate to the registry and added unit tests + documentation describing the contract.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/testsuites/test.py | Adds shared helpers and implements registry + registry loader. |
| src/core/runner.py | Switches tool loading to registry-based dispatch and adds module imports intended to trigger registration. |
| src/testsuites/test_iperf.py | Registers iperf suite, adds from_tool_dict(), and uses shared receiver/defaulting helpers. |
| src/testsuites/test_iperf_bats.py | Registers bats_iperf suite and adds from_tool_dict() + defaulting helper. |
| src/testsuites/test_rtt.py | Registers rtt suite, adds from_tool_dict(), and uses shared helpers. |
| src/testsuites/test_scp.py | Registers scp suite, adds from_tool_dict(), and uses shared receiver resolution. |
| src/testsuites/test_sshping.py | Registers sshping suite and adds from_tool_dict() + receiver resolution. |
| src/testsuites/test_ping.py | Registers ping suite and adds from_tool_dict(). |
| src/testsuites/test_regular.py | Adds from_tool_dict() and uses shared receiver resolution in single-pair mode. |
| src/testsuites/tests/test_suite_unittest.py | Adds unit/integration tests for registry behavior, helpers, and from_tool_dict() mappings. |
| src/testsuites/tests/init.py | Package marker for testsuites tests. |
| docs/test_suite_refactoring.md | Adds/updates documentation describing the extension contract and refactor status. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
load_test_suite_from_registry() now emits a logging.warning() when a matched registry entry class does not provide from_tool_dict(), instead of silently returning None. This surfaces registration mistakes early. Also fixes pylint import-order and unused-variable warnings in runner.py. Co-authored-by: penglei0 <101799503+penglei0@users.noreply.github.com>
…guard The _TESTSUITES_DISCOVERED module-level flag is a valid pattern for lazy initialization; suppress the W0603 warning inline to keep CI green. Co-authored-by: penglei0 <101799503+penglei0@users.noreply.github.com>
Co-authored-by: penglei0 <101799503+penglei0@users.noreply.github.com>
Fixed in |
|
@copilot investigate potential bugs in run_test.sh/extract_data.py;
|
…and post-processing directory Co-authored-by: penglei0 <101799503+penglei0@users.noreply.github.com>
Co-authored-by: penglei0 <101799503+penglei0@users.noreply.github.com>
Fixed in Bug 1 — Flag files never deleted: Bug 2 — Test failures never detected: The quoting on line 223 ( Bug 3 — CSV/MD/index.html in wrong directory: When |
@copilot last commit fail the CI, see details in https://github.com/penglei0/oasis/actions/runs/23088751295/job/67069842797?pr=26#step:9:94 |
…gularTest with timeout) Co-authored-by: penglei0 <101799503+penglei0@users.noreply.github.com>
…s[1] Co-authored-by: penglei0 <101799503+penglei0@users.noreply.github.com>
Fixed in Root cause: the old Fix: |
|
@copilot Do the fix for the following issues:
|
…protocol support Co-authored-by: penglei0 <101799503+penglei0@users.noreply.github.com>
Fixed in
|
Receiver IP resolution logic was duplicated across 5 test suites, client/server defaulting across 4, and adding a new test tool required editing the
load_test_tool()if/elif cascade inrunner.py. This PR centralizes shared logic, introduces a registry pattern, and documents the extension contract.Base class helpers (
src/testsuites/test.py)PROXY_PROTOCOLSfrozenset — single source of truth for proxy-style protocols (KCP, QUIC)resolve_receiver(network, proto_info) → (ip, port)— protocol-aware receiver resolution replacing duplicated logic in IperfTest, RTTTest, ScpTest, SSHPingTest, RegularTest_default_client_server(network)— replaces identical 3-line block in 4 suitesRegistry-based dispatch
@register_test_suitedecorator +from_tool_dict()classmethod on each suiteload_test_suite_from_registry()— exact match first, thencontainsmatch, returnsNonefor fallbackload_test_tool()inrunner.pyreduced from 30-line if/elif cascade to registry delegationAdding a new tool (e.g.
quic_perf) becomes a single-file change:All 7 concrete suites refactored
Each now uses
resolve_receiver()/_default_client_server(), has@register_test_suite, and owns its YAML→config mapping viafrom_tool_dict().SSHPingTest timeout fix
The old
load_test_tool()had no case for'sshping', so it fell through toRegularTestwhich ran the binary in background with&and a kill-after-timeout. The registry now correctly routes toSSHPingTest, which previously ransshpingsynchronously viacmd()(blocking indefinitely if SSH handshake was slow).SSHPingTestnow runssshpingin background with&and uses_wait_and_kill()to enforce a configurable timeout (interval_num × interval + 1seconds), with proper cleanup on all hosts in the multi-host loop.Tests
39 new unit tests covering registry resolution, receiver IP routing for TCP/KCP/QUIC/BTP,
from_tool_dict()for all suite classes, andload_test_tool()integration.Documentation
docs/test_suite_refactoring.mdupdated with implementation status (§9).Bug fixes in
run_test.shThree pre-existing bugs were discovered and fixed when adding the Performance matrix CI step:
delete_flag_files()prepended$current_base_path/to variables that already contained the full absolute path frominit_all_variables(), creating a doubled path that never matched. Bothtest.failedandtest.successcould accumulate across sequential CI test runs.] || [ ! -f ...into the-ffilename argument, making it a single[ -f ]test on a nonsensical path. Since the mangled path never exists, the script always fell through to the "success" branch regardless of actual test outcome.test_nameis not provided via CLI (the default in CI),extract_data.pyandgenerate_index.pyreceivedtest_results/instead of per-test subdirectories liketest_results/test1000/. Fixed by discovering test subdirectories automatically whentest_nameis empty.Bug fixes in
extract_data.py[btp, brtp_proxy, kcp, tcp-bbr]), the old code collected all perf data into a single flat list and wrote one table where only the first match per(loss_rate, latency)was emitted — mixing protocol data or silently dropping entries. Now groups data by protocol and generates a separate CSV section + markdown table per protocol, each under a### protocol_nameheading.(loss_rate, latency)cell had no matching data, no cell was emitted at all, shifting subsequent columns left. Fixed by writing empty placeholder cells for missing data points.Bug fixes in
generate_index.pyid='0. topology'(display name) but the throughput table linked tohref='#topology-0'. Fixed by using the directory nametopology-Nas theidattribute while keeping the human-readable display name as heading text.render_throughput_table()with a newsplit_md_sections()helper to parse the multi-section markdown format (### headings followed by tables), rendering each protocol's data as a separate HTML table with its own<h3>heading.💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.