[2.8] Refresh stale integration tests#4549
Conversation
There was a problem hiding this comment.
Pull request overview
Backport to the 2.8 branch that refreshes stale integration/unit tests and aligns preflight checking + PyTorch recipe fixtures/documentation with tightened contracts (notably around preflight status handling and PyTorch update schema expectations).
Changes:
- Replace numeric preflight checker return codes with a
CheckStatusenum and update CLI/test expectations accordingly. - Refresh integration recipe smoke tests (XGBoost vertical/histogram, experiment tracking) with required per-site/model fixtures and a more robust preflight runner setup.
- Update docs and test job/app configs to match updated PyTorch persistor/schema requirements and CLI naming (
preflight-check).
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
nvflare/tool/package_checker/package_checker.py |
Introduces CheckStatus enum and refactors dry-run check return semantics. |
nvflare/tool/preflight_check.py |
Updates preflight CLI to interpret CheckStatus and map to exit codes/output. |
tests/unit_test/tool/preflight_output_test.py |
Updates/extends unit tests for new preflight status semantics and cleanup behavior. |
tests/integration_test/run_integration_tests.sh |
Ensures localhost0/localhost1 aliases exist before running preflight integration tests. |
tests/integration_test/preflight_check_test.py |
Loosens check assertions to allow additional checks and improves subprocess/pty handling. |
tests/integration_test/xgb_vertical_recipe_test.py |
Adds per-site config helper and passes per-site fixtures required by tightened recipe contracts. |
tests/integration_test/xgb_histogram_recipe_test.py |
Adds per-site config helper and aligns SimEnv usage with explicit client lists. |
tests/integration_test/experiment_tracking_recipes_test.py |
Supplies a model instance by importing the example’s model.py for recipe execution. |
tests/integration_test/data/jobs/hello-pt/app/custom/test_custom.py |
Removes an embedded pytest payload that was being collected unintentionally. |
tests/integration_test/data/jobs/hello-pt/app/config/config_fed_server.json |
Adds required persistor.args.model config for PyTorch persistor. |
tests/integration_test/data/apps/pt_init_client/app/config/config_fed_server.json |
Adds required persistor.args.model config for PyTorch persistor. |
nvflare/app_opt/pt/utils.py |
Clarifies docstring: extra keys may be ignored locally; server-side schema validation rejects unknown keys. |
nvflare/app_opt/pt/model_persistence_format_manager.py |
Clarifies update semantics: server checkpoint defines accepted client update key schema. |
tests/unit_test/app_opt/pt/pt_param_validation_test.py |
Renames tests and clarifies intent around partial updates vs rejecting unknown client keys. |
docs/user_guide/nvflare_cli/preflight_check.rst |
Updates CLI spelling (preflight-check) and documents exit code meanings + updated check names/messages. |
docs/user_guide/data_scientist_guide/job_recipe.rst |
Documents PyTorch update schema expectations (subset allowed; new keys rejected). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile SummaryThis backport from
Confidence Score: 5/5Safe to merge — changes are test and documentation refreshes with a well-scoped enum refactor that fixes an existing misclassification of successful dry runs. The enum refactor is straightforward and fully covered by the new unit tests. The integration test changes tighten expected state without removing meaningful coverage. No production logic paths were altered beyond the preflight-check plumbing. No files require special attention, though the python vs python3 usage in run_integration_tests.sh is worth a second look for portability. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[preflight_check.py check_packages] --> B{should_be_checked?}
B -- No --> C[check_status = PASS]
B -- Yes --> D[p.check]
D --> E{all rules passed?}
E -- No --> F[status = FAIL]
E -- Yes --> G[check_dry_run]
G --> H[run_command_in_subprocess]
H -- timeout --> I[SIGTERM, PASS_WITH_CLEANUP]
H -- returncode 0 --> J[PASS_WITH_CLEANUP]
H -- returncode nonzero --> K[FAIL_WITH_CLEANUP]
H -- Exception --> L[FAIL]
F --> M[check returns status]
I --> M
J --> M
K --> M
L --> M
C --> N{check_status?}
M --> N
N -- PASS_WITH_CLEANUP --> O[stop_dry_run force=False]
N -- FAIL_WITH_CLEANUP --> P[stop_dry_run force=True]
N -- PASS or FAIL --> Q[no cleanup]
O --> R[output_ok / exit 0 or 1]
P --> R
Q --> R
Reviews (2): Last reviewed commit: "Merge branch '2.8' into codex/refresh-in..." | Re-trigger Greptile |
|
/build |
Summary
2.8branch.Validation
PYTHONPYCACHEPREFIX=/tmp/nvflare_pycache python3 -m py_compile nvflare/app_opt/pt/model_persistence_format_manager.py nvflare/app_opt/pt/utils.py nvflare/tool/package_checker/package_checker.py nvflare/tool/preflight_check.py tests/integration_test/experiment_tracking_recipes_test.py tests/integration_test/preflight_check_test.py tests/integration_test/xgb_histogram_recipe_test.py tests/integration_test/xgb_vertical_recipe_test.py tests/unit_test/app_opt/pt/pt_param_validation_test.py tests/unit_test/tool/preflight_output_test.pypython3 -m json.tool tests/integration_test/data/jobs/hello-pt/app/config/config_fed_server.jsonpython3 -m json.tool tests/integration_test/data/apps/pt_init_client/app/config/config_fed_server.jsonbash -n tests/integration_test/run_integration_tests.shgit diff --check upstream/2.8...HEAD