Skip to content

[Meta] Add GitHub workflow for run_scripts pytest unit tests#1237

Open
AarjunC wants to merge 3 commits into
facebook:mainfrom
AarjunC:export-D106542800
Open

[Meta] Add GitHub workflow for run_scripts pytest unit tests#1237
AarjunC wants to merge 3 commits into
facebook:mainfrom
AarjunC:export-D106542800

Conversation

@AarjunC
Copy link
Copy Markdown
Contributor

@AarjunC AarjunC commented May 27, 2026

Summary: Adds a lightweight GHA workflow that runs the pytest unit tests under fboss/oss/scripts/run_scripts/tests/ on PRs that touch run_scripts/**. The existing docker-unittest.py only discovers compiled gtest binaries, so these ~120 pure-Python tests currently run on no PR. Runs in seconds with no getdeps/docker.

Differential Revision: D106542800

AarjunC added 3 commits May 27, 2026 11:59
Summary:
Add per-subclass tests pinning binary names, conditional flag construction,
filter behavior, and warmboot-script dispatch.

- test_sai_agent_runner.py (10): mono vs multi_switch branching for warmboot
file, replayer flags, run-args; production-feature filtering in `_filter_tests`;
warmboot-script dispatch via `_setup_warmboot_test`.
- test_link_runner.py (5): mono vs multi binary, warmboot file by mode,
service start order (FSDB -> QSFP -> HW Agent), --disable-fsdb skip.
- test_platform_services_runner.py (8): parametrized type -> binary map with
fallback; multi-type iteration when --type omitted.
- test_bcm_runner.py (3, NEW): default constants; `_get_sai_logging_flags`
no-arg signature.
- test_sai_runner.py (6, NEW): 5-flag SAI replayer set construction;
optional --platform_mapping_override_path append; known-bad-tests file
override fallback to SAI_HW_KNOWN_BAD_TESTS.
- test_qsfp_runner.py (5, NEW): conditional --platform_mapping_override_path
and --bsp_platform_mapping_override_path appends; coldboot wipes
QSFP_SERVICE_DIR via subprocess.Popen.

Differential Revision: D106428878
Summary:
Add lifecycle tests for the systemd service helpers wrapped by run_test.py
runners. These pin the contract before the planned modular refactor moves
these files into a `services/` subpackage.

- test_agent_service.py (7): warmboot file path helper; cleanup stops the
prod / for_testing / oss service variants and pkills each; setup raises on
missing binary or missing config; setup_and_start dispatches warm vs cold;
warm-boot file-missing behavior pinned for `warm_boot_hw_agent`.
- test_fsdb_service.py (4): cleanup teardown, setup preconditions,
cold-boot creates marker / warm-boot skips, start orchestration.
- test_qsfp_service.py (5): cleanup teardown, setup preconditions, FSDB
disabled vs enabled flips --fsdb_client_ssl_preferred=false in the unit
file, --platform_mapping_override_path appended into ExecStart when set,
cold/warm marker behavior.

Differential Revision: D106437058
Summary: Adds a lightweight GHA workflow that runs the pytest unit tests under `fboss/oss/scripts/run_scripts/tests/` on PRs that touch `run_scripts/**`. The existing `docker-unittest.py` only discovers compiled gtest binaries, so these ~120 pure-Python tests currently run on no PR. Runs in seconds with no getdeps/docker.

Differential Revision: D106542800
@AarjunC AarjunC requested a review from a team as a code owner May 27, 2026 18:59
@meta-cla meta-cla Bot added the CLA Signed label May 27, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 27, 2026

@AarjunC has exported this pull request. If you are a Meta employee, you can view the originating Diff in D106542800.

@AarjunC AarjunC changed the title Add GitHub workflow for run_scripts pytest unit tests [Meta] Add GitHub workflow for run_scripts pytest unit tests May 27, 2026
@github-actions github-actions Bot added the meta label May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant