added test cases for launch processes and conditional launching#298
added test cases for launch processes and conditional launching#298Saumya-R wants to merge 3 commits into
Conversation
|
The created documentation from the pull request is available at: docu-html |
There was a problem hiding this comment.
Pull request overview
This PR adds a new Lifecycle “conditional launching” feature-integration test scenario and a Python FIT suite that runs it against both the Rust and C++ scenario runners. It also introduces a Rust “lifecycle-only” Bazel binary variant intended to avoid pulling in persistency-related dependencies for this specific suite, and updates test harness/configuration to support selective scenario builds.
Changes:
- Added Lifecycle conditional-launching scenarios to the Rust and C++ FIT scenario trees.
- Added a Python requirements-based FIT suite for conditional launching (parametrized for Rust/C++) plus a shared lifecycle base scenario fixture.
- Added a Rust lifecycle-only Bazel scenario binary and updated FIT build selection/docs.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Updates pytest configuration section to tool.pytest.ini_options. |
| feature_integration_tests/test_scenarios/rust/src/scenarios/mod.rs | Registers the new lifecycle scenario group in the Rust scenario tree. |
| feature_integration_tests/test_scenarios/rust/src/scenarios/lifecycle/mod.rs | Adds a lifecycle scenario group (Rust). |
| feature_integration_tests/test_scenarios/rust/src/scenarios/lifecycle/conditional_launching.rs | Implements the Rust conditional-launching scenario input validation/logging. |
| feature_integration_tests/test_scenarios/rust/src/main.rs | Adds lifecycle_only compilation mode and a reduced root group for lifecycle-only builds. |
| feature_integration_tests/test_scenarios/rust/BUILD | Adds rust_lifecycle_test_scenarios Bazel target using --cfg=lifecycle_only. |
| feature_integration_tests/test_scenarios/cpp/src/scenarios/mod.cpp | Registers a lifecycle scenario group (C++). |
| feature_integration_tests/test_scenarios/cpp/src/scenarios/lifecycle/conditional_launching.h | Declares the C++ conditional-launching scenario factory. |
| feature_integration_tests/test_scenarios/cpp/src/scenarios/lifecycle/conditional_launching.cpp | Implements the C++ conditional-launching scenario parsing/logging. |
| feature_integration_tests/test_cases/tests/lifecycle/test_conditional_launching.py | Adds Python FIT assertions for lifecycle conditional launching (Rust/C++). |
| feature_integration_tests/test_cases/lifecycle_scenario.py | Introduces a shared LifecycleScenario base class with a common temp_dir fixture. |
| feature_integration_tests/test_cases/conftest.py | Skips building unselected scenario variants based on the pytest mark expression. |
| feature_integration_tests/test_cases/BUILD | Adds lifecycle_scenario.py to FIT runfiles. |
| feature_integration_tests/README.md | Documents running lifecycle conditional-launching FITs and the lifecycle-only Rust target. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
added test case to reject unknown conditions fixed the readme added launch manager processes adding additional test cases for lifecycle
816b818 to
1c7d861
Compare
PiotrKorkus
left a comment
There was a problem hiding this comment.
also remove duplicated dependency/ordering tests across daemon files
| "RUST_BACKTRACE": "1", | ||
| }, | ||
| pytest_config = "//:pyproject.toml", | ||
| tags = ["exclusive"], |
There was a problem hiding this comment.
lifecycle targets drive a shared launch_manager daemon and one of the rust or cpp times out when ran concurrently.
| "daemon_helpers.py", | ||
| "fit_scenario.py", | ||
| "lifecycle_scenario.py", | ||
| "persistency_scenario.py", |
There was a problem hiding this comment.
cleared the non-required.
There was a problem hiding this comment.
those bazel targets are messed up, create a separate targets for rust/cpp lifecycle, pers, orch etc. Group everything under test_suites for cpp and rust.
Just add one more level of test suites by promoting current fit_cpp and fit_rust into test suites
| @add_test_properties( | ||
| partially_verifies=[ | ||
| "feat_req__lifecycle__total_wait_time_support", | ||
| "feat_req__lifecycle__polling_interval", | ||
| "feat_req__lifecycle__path_condition_check", | ||
| "feat_req__lifecycle__env_variable_cond_check", | ||
| "feat_req__lifecycle__dependency_check", | ||
| ], | ||
| test_type="requirements-based", | ||
| derivation_technique="requirements-analysis", | ||
| ) | ||
| class TestConditionalLaunchingScenario(LifecycleScenario): |
There was a problem hiding this comment.
so those tests do not verify reqs, they verify the scenario
| if sched is None: | ||
| pytest.skip("Could not inspect scheduling metadata via chrt in this environment") |
There was a problem hiding this comment.
this is always skipped, test never contributes to verifify something
| f"(cpp_start={cpp_start}, rust_start={rust_start})" | ||
| ) | ||
|
|
||
| def test_rust_never_runs_without_cpp_running( |
There was a problem hiding this comment.
but launch manager daemon fixutre always waits for both apps running, how does this test conrtibute to requirements verification? Its test harness check
| launch_manager_daemon: dict[str, Any], | ||
| version: str, | ||
| ) -> None: | ||
| """Verify launched process runs with configured effective uid/gid when runtime applies sandbox identity.""" |
There was a problem hiding this comment.
what if gid is not applied? thats a pre condition from the outside, where is it set? Should the test be skipped if that was not prepared?
| def test_config_defines_startup_retry_policy(self, launch_manager_daemon: dict[str, Any], version: str) -> None: | ||
| """Verify lifecycle config defines configurable restart attempts on startup readiness failure.""" | ||
| config_path = Path(__file__).resolve().parents[3] / "configs" / "lifecycle_daemon_config.json" | ||
| config = json.loads(config_path.read_text(encoding="utf-8")) | ||
|
|
||
| restart_cfg = config["defaults"]["deployment_config"]["ready_recovery_action"]["restart"] | ||
| attempts = restart_cfg.get("number_of_attempts") | ||
| assert isinstance(attempts, int), "Expected integer number_of_attempts in ready_recovery_action.restart" | ||
| assert attempts >= 0, "Expected non-negative number_of_attempts in startup retry policy" |
There was a problem hiding this comment.
thats reading json and asserting it, test makes no sense
There was a problem hiding this comment.
deleted test_config_defines_startup_retry_policy — it only parsed and type-checked JSON, verifying nothing about runtime behavior. retries_configurable and monitor_abnormal_term are now both attributed to test_supervised_app_recovery, which is the one test that actually forces a failure and observes daemon-driven restart.
This branch introduces lifecycle integration coverage for Launching Processes and Conditional Launching using a real launch_manager daemon setup, updates test infrastructure to reduce false negatives, and refreshes documentation/roadmap artifacts.