added test cases for launch processes and conditional launching - #298
added test cases for launch processes and conditional launching#298Saumya-R wants to merge 6 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.
816b818 to
1c7d861
Compare
PiotrKorkus
left a comment
There was a problem hiding this comment.
also remove duplicated dependency/ordering tests across daemon files
| 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
There was a problem hiding this comment.
Skip messages now report a concrete sandbox_privileged_reason, and README documents FIT_ENABLE_SETCAP=1 + sudoers setup so the test can actually run instead of always skipping
There was a problem hiding this comment.
still skipping the test does not verify req - is there any blocker from running it on CI?
There was a problem hiding this comment.
launch_manager the cap_setuid,cap_setgid,cap_sys_nice file capabilities via setcap, which
in turn requires CAP_SETFCAP — not available to a non-root test runner by default.
The test opts into sudo -n setcap only when FIT_ENABLE_SETCAP=1 is set and requires bazel's --test_env=FIT_ENABLE_SETCAP=1 to propagate it.
The fix belongs: .github/workflows/test_and_docs.yml, the test_and_docs job
Two things are missing for the test to actually exercise the capability path there, both CI-infra changes:
- A passwordless sudoers rule for setcap — needs to be provisioned on the ubuntu-latest runner before the test step, e.g. a new step like:
- name: Allow passwordless setcap for FIT
run: echo "$USER ALL=(root) NOPASSWD: /usr/sbin/setcap" | sudo tee /etc/sudoers.d/fit-setcap
- Passing FIT_ENABLE_SETCAP=1 through Bazel — since env_inherit = ["FIT_ENABLE_SETCAP"] is already declared in test_cases/BUILD:115,180, the workflow just needs:
bazel test --config=linux-x86_64 --test_env=FIT_ENABLE_SETCAP=1 //feature_integration_tests/test_cases:fit
with the env var exported in the job (or step) environment.
7bc8cd9 to
d1cddfa
Compare
| if sched is None: | ||
| pytest.skip("Could not inspect scheduling metadata via chrt in this environment") |
There was a problem hiding this comment.
still skipping the test does not verify req - is there any blocker from running it on CI?
Copyright fixes added test case to reject unknown conditions fixed the readme added launch manager processes adding additional test cases for lifecycle removing the changes in pyproject and requirements txt added review comment fixes: - cleared the non-required. - removed the dead LIFECYCLE_TESTS_SUMMARY.md doc reference. - dropped the class-level 13-req partially_verifies blanket claim; each requirement is now tagged on the specific test that actually exercises it (add_test_properties moved onto individual methods) - deleted test_config_defines_startup_retry_policy Adding review comments added the following fixes : - The scenario now actually polls and checks each condition instead of printing it - Replaced plain std::cout text with the same structured JSON log shape the Rust tracing subscriber emits - TestConditionalLaunchingScenario now creates a real flag file, sets a real env var, and spawns a real sleep process - Added TestConditionalLaunchingScenarioTimesOutOnUnmetConditions, a negative test where none of the conditions are ever satisfied - removed test_startup_launches_supervised_apps and test_dependency_gates_rust_startup from test_process_launching_with_daemon.py - TestConditionalLaunchingBlocksOnMissingDependency spins up its own launch_manager with cpp withheld to prove real gating added TestConditionalLaunchingScenarioRejectsUnsupportedPrefix
3d81256 to
37ddbd4
Compare
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.
feat_req__lifecycle__parallel_launch_support,feat_req__lifecycle__process_launch_args,feat_req__lifecycle__uid_gid_support,feat_req__lifecycle__launch_priority_support,feat_req__lifecycle__scheduling_policy,feat_req__lifecycle__retries_configurable,feat_req__lifecycle__secpol_non_root,feat_req__lifecycle__monitor_abnormal_termTestProcessLaunchingWithDaemon)pytest.mark.manual)feat_req__lifecycle__liveliness_detection,feat_req__lifecycle__smart_watchdog_configTestHealthMonitoringWithDaemon)feat_req__lifecycle__launch_support,feat_req__lifecycle__waitfor_support,feat_req__lifecycle__cond_process_start,feat_req__lifecycle__dependency_check,feat_req__lifecycle__process_orderingTestConditionalLaunchingWithDaemon,TestConditionalLaunchingBlocksOnMissingDependency)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,feat_req__lifecycle__validate_conditionsTestConditionalLaunchingScenario,TestConditionalLaunchingScenarioTimesOutOnUnmetConditions,TestConditionalLaunchingScenarioRejectsUnsupportedPrefix)