Skip to content

Commit 20077ef

Browse files
committed
cleaning the redundant test cases
1 parent e0a01aa commit 20077ef

23 files changed

Lines changed: 192 additions & 3109 deletions

feature_integration_tests/LIFECYCLE_TESTS_SUMMARY.md

Lines changed: 166 additions & 777 deletions
Large diffs are not rendered by default.

feature_integration_tests/test_cases/BUILD

Lines changed: 11 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -40,134 +40,9 @@ launch_manager_config(
4040
config = "//feature_integration_tests/test_cases/configs:daemon_launch_manager_config.json",
4141
)
4242

43-
# Tests targets
44-
score_py_pytest(
45-
name = "fit_rust",
46-
srcs = glob(
47-
["tests/**/*.py"],
48-
exclude = [
49-
"tests/lifecycle/test_process_launching_with_daemon.py",
50-
"tests/lifecycle/test_lifecycle_state_manager_if.py",
51-
"tests/lifecycle/test_lifecycle_persistency_recovery.py",
52-
],
53-
),
54-
args = [
55-
"-m",
56-
"rust",
57-
"--traces=all",
58-
"--rust-target-path=$(rootpath //feature_integration_tests/test_scenarios/rust:rust_test_scenarios)",
59-
],
60-
data = [
61-
"conftest.py",
62-
"daemon_helpers.py",
63-
"fit_scenario.py",
64-
"lifecycle_scenario.py",
65-
"persistency_scenario.py",
66-
"test_properties.py",
67-
"//feature_integration_tests/test_scenarios/rust:rust_test_scenarios",
68-
],
69-
env = {
70-
"RUST_BACKTRACE": "1",
71-
},
72-
pytest_config = "//:pyproject.toml",
73-
deps = all_requirements,
74-
)
75-
76-
score_py_pytest(
77-
name = "fit_cpp",
78-
srcs = glob(
79-
["tests/**/*.py"],
80-
exclude = [
81-
"tests/lifecycle/test_process_launching_with_daemon.py",
82-
"tests/lifecycle/test_lifecycle_state_manager_if.py",
83-
"tests/lifecycle/test_lifecycle_persistency_recovery.py",
84-
],
85-
),
86-
args = [
87-
"-m",
88-
"cpp",
89-
"--traces=all",
90-
"--cpp-target-path=$(rootpath //feature_integration_tests/test_scenarios/cpp:cpp_test_scenarios)",
91-
],
92-
data = [
93-
"conftest.py",
94-
"daemon_helpers.py",
95-
"fit_scenario.py",
96-
"lifecycle_scenario.py",
97-
"persistency_scenario.py",
98-
"test_properties.py",
99-
"//feature_integration_tests/test_scenarios/cpp:cpp_test_scenarios",
100-
],
101-
pytest_config = "//:pyproject.toml",
102-
deps = all_requirements,
103-
)
104-
105-
# Daemon integration tests (Rust)
106-
score_py_pytest(
107-
name = "fit_daemon_rust",
108-
srcs = glob(["tests/**/*.py"]),
109-
args = [
110-
"-m rust",
111-
"--traces=all",
112-
"--rust-target-path=$(rootpath //feature_integration_tests/test_scenarios/rust:rust_test_scenarios)",
113-
"-k with_daemon",
114-
],
115-
data = [
116-
"conftest.py",
117-
"daemon_helpers.py",
118-
"fit_scenario.py",
119-
"lifecycle_scenario.py",
120-
"persistency_scenario.py",
121-
"test_properties.py",
122-
"//feature_integration_tests/test_scenarios/rust:rust_test_scenarios",
123-
"@score_lifecycle_health//examples/rust_supervised_app",
124-
"@score_lifecycle_health//examples/cpp_supervised_app",
125-
"@score_lifecycle_health//examples/control_application:control_daemon",
126-
"@score_lifecycle_health//src/launch_manager_daemon:launch_manager",
127-
":daemon_lifecycle_configs",
128-
],
129-
env = {
130-
"RUST_BACKTRACE": "1",
131-
},
132-
pytest_config = "//:pyproject.toml",
133-
deps = all_requirements,
134-
)
135-
136-
# Daemon integration tests (C++)
137-
score_py_pytest(
138-
name = "fit_daemon_cpp",
139-
srcs = glob(["tests/**/*.py"]),
140-
args = [
141-
"-m cpp",
142-
"--traces=all",
143-
"--cpp-target-path=$(rootpath //feature_integration_tests/test_scenarios/cpp:cpp_test_scenarios)",
144-
"-k with_daemon",
145-
],
146-
data = [
147-
"conftest.py",
148-
"daemon_helpers.py",
149-
"fit_scenario.py",
150-
"lifecycle_scenario.py",
151-
"persistency_scenario.py",
152-
"test_properties.py",
153-
"//feature_integration_tests/test_scenarios/cpp:cpp_test_scenarios",
154-
"@score_lifecycle_health//examples/rust_supervised_app",
155-
"@score_lifecycle_health//examples/cpp_supervised_app",
156-
"@score_lifecycle_health//examples/control_application:control_daemon",
157-
"@score_lifecycle_health//src/launch_manager_daemon:launch_manager",
158-
":daemon_lifecycle_configs",
159-
],
160-
pytest_config = "//:pyproject.toml",
161-
deps = all_requirements,
162-
)
163-
164-
test_suite(
165-
name = "fit",
166-
tests = [
167-
":fit_cpp",
168-
":fit_rust",
169-
],
170-
)
43+
# Cross-Module Integration Tests
44+
# This branch focuses on cross-module lifecycle integration tests that require daemon supervision.
45+
# API-level integration tests are maintained in the saumya_lifecycle_fit branch.
17146

17247
# Architecture-based IPC boundary + cross-module lifecycle integration tests (Rust)
17348
score_py_pytest(
@@ -234,12 +109,18 @@ score_py_pytest(
234109
deps = all_requirements,
235110
)
236111

112+
test_suite(
113+
name = "fit",
114+
tests = [
115+
":fit_daemon_lifecycle_arc_cpp",
116+
":fit_daemon_lifecycle_arc_rust",
117+
],
118+
)
119+
237120
test_suite(
238121
name = "fit_daemon",
239122
tests = [
240-
":fit_daemon_cpp",
241123
":fit_daemon_lifecycle_arc_cpp",
242124
":fit_daemon_lifecycle_arc_rust",
243-
":fit_daemon_rust",
244125
],
245126
)

feature_integration_tests/test_cases/daemon_helpers.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,9 @@ def _should_skip(name: str) -> bool:
289289
shutil.copy2(flatbuffer_file, etc_dir / flatbuffer_file.name)
290290

291291

292-
def copy_dynamic_flatbuffer_daemon_configs(etc_dir: Path, work_dir: Path, bin_dir: Path, config_file: Path, *, uid: int, gid: int) -> None:
292+
def copy_dynamic_flatbuffer_daemon_configs(
293+
etc_dir: Path, work_dir: Path, bin_dir: Path, config_file: Path, *, uid: int, gid: int
294+
) -> None:
293295
"""
294296
Generate and copy daemon flatbuffer configs with runtime sandbox identity.
295297
@@ -346,8 +348,7 @@ def copy_dynamic_flatbuffer_daemon_configs(etc_dir: Path, work_dir: Path, bin_di
346348
materialize_res = subprocess.run(materialize_cmd, capture_output=True, text=True, check=False)
347349
if materialize_res.returncode != 0:
348350
raise RuntimeError(
349-
"Failed to materialize daemon config toolchain artifacts.\n"
350-
f"stderr:\n{materialize_res.stderr.strip()}"
351+
f"Failed to materialize daemon config toolchain artifacts.\nstderr:\n{materialize_res.stderr.strip()}"
351352
)
352353

353354
ws_info_res = subprocess.run(["bazel", "info", "execution_root"], capture_output=True, text=True, check=False)
@@ -383,8 +384,7 @@ def copy_dynamic_flatbuffer_daemon_configs(etc_dir: Path, work_dir: Path, bin_di
383384
gen_res = subprocess.run(gen_cmd, capture_output=True, text=True, check=False)
384385
if gen_res.returncode != 0:
385386
raise RuntimeError(
386-
"Failed to generate intermediate lifecycle JSON configs.\n"
387-
f"stderr:\n{gen_res.stderr.strip()}"
387+
f"Failed to generate intermediate lifecycle JSON configs.\nstderr:\n{gen_res.stderr.strip()}"
388388
)
389389

390390
flatc_bin = get_binary_path("@flatbuffers//:flatc")
@@ -414,8 +414,7 @@ def copy_dynamic_flatbuffer_daemon_configs(etc_dir: Path, work_dir: Path, bin_di
414414
)
415415
if compile_res.returncode != 0:
416416
raise RuntimeError(
417-
f"Failed to compile dynamic flatbuffer config for {filename}.\n"
418-
f"stderr:\n{compile_res.stderr.strip()}"
417+
f"Failed to compile dynamic flatbuffer config for {filename}.\nstderr:\n{compile_res.stderr.strip()}"
419418
)
420419

421420
# When using JSON config mode, exclude only process-level configs.
@@ -718,11 +717,9 @@ def launch_manager_daemon(
718717
"description": "State Manager application (minimal control daemon)",
719718
"component_properties": {
720719
"binary_name": "control_daemon",
721-
"application_profile": {
722-
"application_type": "Native"
723-
},
724-
"depends_on": []
725-
}
720+
"application_profile": {"application_type": "Native"},
721+
"depends_on": [],
722+
},
726723
}
727724
},
728725
"run_targets": {
@@ -740,7 +737,9 @@ def launch_manager_daemon(
740737
# sandbox identity aligns with the active runtime user.
741738
if os.environ.get("FIT_ENABLE_SETCAP", "0") == "1":
742739
# Dynamic config generation writes to config_file directly
743-
copy_dynamic_flatbuffer_daemon_configs(etc_dir, work_dir, bin_dir, config_file, uid=current_uid, gid=current_gid)
740+
copy_dynamic_flatbuffer_daemon_configs(
741+
etc_dir, work_dir, bin_dir, config_file, uid=current_uid, gid=current_gid
742+
)
744743
else:
745744
# Write programmatic config for non-setcap mode
746745
config_file.write_text(json.dumps(config, indent=2))

feature_integration_tests/test_cases/tests/lifecycle/test_conditional_launching.py

Lines changed: 0 additions & 153 deletions
This file was deleted.

0 commit comments

Comments
 (0)