Lifecycle Feature Integration Tests #238
Conversation
|
The created documentation from the pull request is available at: docu-html |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new “lifecycle” feature integration test suite (Rust + C++) and a corresponding Python test layer to validate lifecycle/Launch Manager requirement coverage.
Changes:
- Register a new
lifecyclescenario group for both Rust and C++ scenario runners. - Add lifecycle scenario implementations (Rust uses lifecycle + health monitoring libs; C++ provides mostly stdout-based demonstrations).
- Add Python pytest test cases + shared
LifecycleScenariobase class; include new lifecycle documentation.
Reviewed changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| feature_integration_tests/test_scenarios/rust/src/scenarios/mod.rs | Registers lifecycle scenario group under root. |
| feature_integration_tests/test_scenarios/rust/src/scenarios/lifecycle/mod.rs | Adds lifecycle scenario group wiring for Rust. |
| feature_integration_tests/test_scenarios/rust/src/scenarios/lifecycle/launch_manager_support.rs | Implements Rust lifecycle scenarios (health monitoring + lifecycle client). |
| feature_integration_tests/test_scenarios/rust/BUILD | Adds Rust deps for lifecycle/health monitoring libraries. |
| feature_integration_tests/test_scenarios/cpp/src/scenarios/mod.cpp | Registers lifecycle scenario group under root (C++). |
| feature_integration_tests/test_scenarios/cpp/src/scenarios/lifecycle/launch_manager_support.h | Declares lifecycle scenario factory functions (C++). |
| feature_integration_tests/test_scenarios/cpp/src/scenarios/lifecycle/launch_manager_support.cpp | Implements lifecycle scenarios (primarily stdout demonstrations; one lifecycle client call). |
| feature_integration_tests/test_scenarios/cpp/BUILD | Adds C++ lifecycle client dependency. |
| feature_integration_tests/test_cases/tests/lifecycle/test_run_targets.py | Adds pytest validations for run-target behavior/log output. |
| feature_integration_tests/test_cases/tests/lifecycle/test_process_termination.py | Adds pytest validations for termination behavior/log output. |
| feature_integration_tests/test_cases/tests/lifecycle/test_process_security.py | Adds pytest validations for security-related output. |
| feature_integration_tests/test_cases/tests/lifecycle/test_process_resources.py | Adds pytest validations for resource-management output. |
| feature_integration_tests/test_cases/tests/lifecycle/test_process_management.py | Adds pytest validations for process-management output. |
| feature_integration_tests/test_cases/tests/lifecycle/test_process_launching.py | Adds pytest validations for lifecycle client integration output. |
| feature_integration_tests/test_cases/tests/lifecycle/test_process_arguments.py | Adds pytest validations for argument/cwd output. |
| feature_integration_tests/test_cases/tests/lifecycle/test_parallel_launching.py | Adds pytest validations for parallel-monitor output. |
| feature_integration_tests/test_cases/tests/lifecycle/test_monitoring_and_recovery.py | Adds pytest validations for monitoring/recovery output. |
| feature_integration_tests/test_cases/tests/lifecycle/test_logging.py | Adds pytest validations for logging-support output. |
| feature_integration_tests/test_cases/tests/lifecycle/test_io_and_file_descriptors.py | Adds pytest validations for I/O + FD management output. |
| feature_integration_tests/test_cases/tests/lifecycle/test_dependency_ordering.py | Adds pytest validations for sequential checkpoint output. |
| feature_integration_tests/test_cases/tests/lifecycle/test_debug_and_terminal.py | Adds pytest validations for debug/terminal output. |
| feature_integration_tests/test_cases/tests/lifecycle/test_control_interface_support.py | Adds pytest validations for custom-condition output. |
| feature_integration_tests/test_cases/tests/lifecycle/test_control_commands.py | Adds pytest validations for control/query command output. |
| feature_integration_tests/test_cases/tests/lifecycle/test_configuration_management.py | Adds pytest validations for configuration-management output. |
| feature_integration_tests/test_cases/lifecycle_scenario.py | Introduces shared base class + helpers for lifecycle FITs. |
| feature_integration_tests/test_cases/BUILD | Adds new lifecycle scenario module to Bazel test data. |
| feature_integration_tests/README_FIT_LIFECYCLE.md | Adds detailed lifecycle FIT documentation. |
| feature_integration_tests/LIFECYCLE_TESTS_SUMMARY.md | Adds summary of lifecycle FIT coverage and inventory. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
335aff1 to
e4a0697
Compare
424c6c2 to
2dd9ed2
Compare
1305799 to
0b45ed8
Compare
|
@Saumya-R can you please rebase |
0b45ed8 to
6157870
Compare
863dea8 to
ad8d0d7
Compare
|
@FScholPer The branch is rebased. |
f8f0489 to
ba1be07
Compare
) * ci: enable cr_checker copyright check via pre-commit hook * fix: add copyright headers to files missing SPDX block * fix: add missing copyright header to overall_status.rst * fix: remove broken copyright_checker Bazel target * fix: add missing blank line after copyright block in overall_status.rst doc: remove scrample references from ebclfsa documentation + update devcontainer (eclipse-score#269) * chore: Bump devcontainer to v.1.7.0 * doc: remove scrample references in the EB clfsa documentation The scrample code had been removed already but this document was forgotten. upload sarif results to security tab (eclipse-score#260) Co-authored-by: Frank Scholter Peres(MBTI) <145544737+FScholPer@users.noreply.github.com> Integrate Time module (eclipse-score#273) * Integrate Time module * Deploy time examples * Make sure qemu has enought permisisons * Make exmplaes stop after time Bump `score_bazel_cpp_toolchains` to the latest version (eclipse-score#274) The latest version of toolchain provides support for coverage for QNX builds. Signed-off-by: Nikola Radakovic <nikola.ra.radakovic@bmw.de> Add QNX8 aarch64 build support (eclipse-score#241) * Add QNX8 aarch64 build support * review findings * free more space adding launch manager fit test cases adding feature integration test cases for other requirements removing hard fail conditions updated documents adding copilot reivew fixes Fixed restart behavior on the same instance, Hardened shutdown race handling updated the statement clearing self.process after shutdown fixed pytest build environment issues fixxing the python build issues copyright fixes
ba1be07 to
160f9c6
Compare
| } | ||
| }; | ||
|
|
||
| std::vector<std::string> parse_string_array_field(const std::string& input, const std::string& field_name) { |
There was a problem hiding this comment.
L3 — MED/LOW: parse_string_array_field regex JSON parsing is unsound. (a) Not scoped to the test object — regex_search runs over the whole document and returns the first same-named array anywhere (e.g. one in defaults shadows test.args). (b) \[(.*?)\] truncates at the first ], breaking nested arrays and any ] inside a string value. (c) the value regex \"([^\"]*)\" treats an escaped \" as a terminator, yielding garbage tokens. Use the JSON parser already used elsewhere in this file and navigate root -> test -> field.
| self.process = None | ||
| raise RuntimeError(f"Launch Manager daemon failed to start. Exit code: {return_code}\nLogs:\n{log_content}") | ||
|
|
||
| def stop(self, shutdown_timeout: float = 5.0) -> None: |
There was a problem hiding this comment.
L4 — MED/LOW: daemon child processes leaked; logs truncated on restart. stop() signals only the daemon, not its process group (no start_new_session/os.killpg), so supervised children are orphaned on daemon crash/start failure and pollute later pgrep -f runs. Separately, open(self.log_file, "w") (line 258) truncates on every start(), discarding pre-restart supervision logs before test_supervised_app_launches asserts on them.
| ) | ||
|
|
||
| if result.returncode == 0: | ||
| pid = result.stdout.strip().split("\n")[0] |
There was a problem hiding this comment.
L5 — MED/LOW: pgrep -f <app_name> first-PID match is fragile. -f matches the full command line and only the first match is taken (lines 205, 221), so a leaked process from a prior run, a bazel invocation, or the pytest cmdline referencing the app name can be selected — making assert new_pid != pid meaningless. Match the exact binary and handle multiple PIDs.
| else: | ||
| logs = daemon.get_logs() | ||
| recovery_signals = [ | ||
| f"unexpected termination of process", |
There was a problem hiding this comment.
L6 — LOW: dead f-string prefixes. f"unexpected termination of process" (line 233) and f"Got kRunning timeout for process" (line 236) have no interpolation — drop the f. Harmless, but flags copy-paste.
| }, | ||
| "run_target": { | ||
| "transition_timeout": 10, | ||
| "recovery_action": {"switch_run_target": {"run_target": "fallback"}}, |
There was a problem hiding this comment.
L7 — MED/LOW: create_daemon_integrated_config fallback target name mismatch (dead code). Uses switch_run_target -> "fallback" while the shipped schema uses the top-level fallback_run_target (configs/daemon_launch_manager_config.json:103). Recovery may not resolve to the intended fallback if this helper is ever used.
…ow mean the same thing
This PR introduces a comprehensive test suite for S-CORE lifecycle management framework integration, validating that applications can properly integrate with lifecycle services.
Coverage
92% requirement coverage: 85 of 92 lifecycle requirements validated
Dual language support: All tests implemented in both Rust and C++
10 major capability areas: Process launching, dependency management, conditional launching, run targets, termination, monitoring & recovery, control interface, configuration, logging, and debug support
Key Features
Validated Capabilities:
Technical Approach
Lifecycle Integration Test Coverage
Click to expand full coverage table
test_custom_condition_signaled,test_control_interface_integrationcustom_cond_supporttest_process_args_received,test_working_directory_setprocess_launch_args,cwd_support,process_input_outputtest_uid_gid_configured,test_security_policy,test_supplementary_groupsuid_gid_support,capability_support,support_secpol_type,secpol_non_root,supplementary_groupstest_priority_configured,test_scheduling_policy,test_cpu_affinity,test_resource_limitslaunch_priority_support,scheduling_policy,runmask_support,process_rlimit_support,aslr_supporttest_condition_timeout_configured,test_process_condition_check,test_dependency_check,test_path_condition_check,test_env_condition_check,test_polling_interval_configuredwaitfor_support,cond_process_start,total_wait_time_support,polling_interval,validate_conditions,validation_conditions,launcher_status_storage,condition_check_method,config_actions_cond,path_condition_check,env_variable_cond_check,dependency_check,check_dependency_exec,define_swc_dependencies,stop_sequencetest_process_adoption,test_multiple_instances,test_dependency_validation,test_stop_orderrunning_processes,drop_supervsion,multi_start_support,consistent_dependencies,stop_process_dependents,stop_order_spec,oci_complianttest_run_target_defined,test_run_target_started,test_run_target_switch,test_process_state_communicationrun_target_support,start_named_run_target,switch_run_targets,process_state_commtest_graceful_shutdown,test_fast_shutdown,test_dependency_order_termination,test_signal_delay_configured,test_stop_timeout_configuredconfigurable_timeout,process_termination,terminationn_dependency,time_to_wait_config,launch_manager_shutdown,slow_shutdown_support,fast_shutdown_support,launcher_exit_shutdown,shutdown_signaltest_failure_detection,test_process_monitoring,test_liveliness_detection,test_recovery_action_configured,test_watchdog_configured,test_external_notification,test_self_health_checkmonitor_abnormal_term,ext_monitor_notify,recovery_action_support,recov_run_target_switch,smart_watchdog_config,configurable_wait_time,monitoring_processes,failure_detect,liveliness_detection,process_monitoring,process_failure_react,multi_instance_support,lm_self_health_check,lm_ext_watchdog_notify,lm_ext_wdg_failed_test,lm_ext_watchdog_cfgtest_control_commands_available,test_query_commands_available,test_status_reporting,test_run_target_activationcontrol_commands,query_commands,controlif_status,request_run_target_starttest_process_launch_logged,test_state_transitions_logged,test_timestamp_present,test_dag_loggingslog2_logging,process_logging_support,log_timestamp,dag_logging_controlif,dependency_visutest_modular_config_support,test_oci_compatibility,test_session_extension,test_module_clustering,test_default_properties,test_lazy_executable_check,test_config_validationmodular_config_support,runtime_config_compat,session_extension,clustering_modules_supp,central_default_defines,lazy_check,deps_visualization,offline_config_validtest_debug_mode_enabled,test_debugger_wait_state,test_terminal_session_leaderdebug_support,support_held_state,terminal_supporttest_stdout_redirection,test_stderr_redirection,test_fd_inheritance_control,test_process_detachment,test_retry_configurationstd_handle_redir,fd_inheritance,detach_parent_process,retries_configurable