Skip to content

Commit 512cdb2

Browse files
committed
Updated the docstring to accurately reflect the implementation , Removed the problematic chmod operations on user's home directory
1 parent 6871eb3 commit 512cdb2

3 files changed

Lines changed: 21 additions & 44 deletions

File tree

feature_integration_tests/README.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,14 @@ For full lifecycle requirement mapping and detailed rationale, see `feature_inte
4242
Python tests are managed with Bazel and Pytest. To run all integration tests:
4343

4444
```sh
45-
bazel test --config=linux-x86_64 //feature_integration_tests/test_cases:fit
45+
bazel test --config=linux-x86_64 //feature_integration_tests/test_cases:fit_daemon
4646
```
4747

48-
To run specific test suites:
48+
To run lifecycle integration tests by language:
4949

5050
```sh
51-
bazel test --config=linux-x86_64 //feature_integration_tests/test_cases:fit_rust
52-
bazel test --config=linux-x86_64 //feature_integration_tests/test_cases:fit_cpp
53-
```
54-
55-
To run daemon integration test suites:
56-
57-
```sh
58-
bazel test --config=linux-x86_64 //feature_integration_tests/test_cases:fit_daemon_rust
59-
bazel test --config=linux-x86_64 //feature_integration_tests/test_cases:fit_daemon_cpp
60-
```
61-
62-
To run lifecycle-focused tests only:
63-
64-
```sh
65-
bazel test --config=linux-x86_64 //feature_integration_tests/test_cases:fit_rust --test_filter="*lifecycle*"
66-
bazel test --config=linux-x86_64 //feature_integration_tests/test_cases:fit_cpp --test_filter="*lifecycle*"
51+
bazel test --config=linux-x86_64 //feature_integration_tests/test_cases:fit_daemon_lifecycle_arc_rust
52+
bazel test --config=linux-x86_64 //feature_integration_tests/test_cases:fit_daemon_lifecycle_arc_cpp
6753
```
6854

6955
Pytest direct local runs are also supported:

feature_integration_tests/test_cases/BUILD

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,6 @@ score_py_pytest(
111111
deps = all_requirements,
112112
)
113113

114-
test_suite(
115-
name = "fit",
116-
tests = [
117-
":fit_daemon_lifecycle_arc_cpp",
118-
":fit_daemon_lifecycle_arc_rust",
119-
],
120-
)
121-
122114
test_suite(
123115
name = "fit_daemon",
124116
tests = [

feature_integration_tests/test_cases/daemon_helpers.py

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -219,18 +219,17 @@ def get_binary_path(target: str, version: str = "rust") -> Path:
219219

220220
def copy_flatbuffer_daemon_configs(etc_dir: Path, *, include_lm_config: bool = True) -> None:
221221
"""
222-
Populate `etc_dir` with per-process health-monitor flatbuffer config binaries.
222+
Populate `etc_dir` with flatbuffer daemon config binaries from build outputs.
223223
224-
Only ``hmproc_*.bin`` files are copied. The cluster-level health-monitor
225-
configs (``hmcore.bin``, ``hm_demo.bin``) define a ``MainCluster`` topology
226-
that expects specific processes to be present in the LM config at startup.
227-
Because the test fixture starts the daemon with a minimal JSON config that
228-
has *empty* components (components are added dynamically by each test), those
229-
files would make the HM thread fail to initialise — so they are always
230-
excluded here.
224+
All ``*.bin`` files from the ``daemon_lifecycle_configs`` target are copied,
225+
with the following exceptions:
231226
232-
``lm_demo.bin`` is the static demo LM config; it is excluded when
233-
``include_lm_config=False`` (the default for all JSON-config-based tests).
227+
- ``hmproc_state_manager.bin`` is always excluded because the test fixture
228+
provides a minimal JSON config with a dynamically-managed state_manager
229+
component; copying this static process-level config would create conflicts.
230+
- ``lm_demo.bin`` is excluded when ``include_lm_config=False`` (the default
231+
for integration tests where a JSON config is passed directly as a CLI
232+
argument instead of using the static flatbuffer LM config).
234233
235234
Parameters
236235
----------
@@ -241,10 +240,8 @@ def copy_flatbuffer_daemon_configs(etc_dir: Path, *, include_lm_config: bool = T
241240
integration tests) when a JSON config file is passed to the daemon
242241
directly as a CLI argument.
243242
"""
244-
# When using JSON config mode (which provides components dynamically), we must
245-
# exclude only the process-level configs that reference pre-defined components.
246-
# Core topology files (hmcore.bin, hm_demo.bin, lm_demo.bin) define the cluster
247-
# structure and are required for daemon initialization.
243+
# Exclude only configs that conflict with dynamically-provided components
244+
# or those not needed when using JSON config mode.
248245
_EXCLUDED_IN_JSON_MODE = {"hmproc_state_manager.bin"}
249246

250247
def _should_skip(name: str) -> bool:
@@ -658,10 +655,12 @@ def launch_manager_daemon(
658655
# Set FIT_ENABLE_SETCAP=1 to prompt for sudo password and apply setcap.
659656
if os.environ.get("FIT_ENABLE_SETCAP", "0") == "1":
660657
try:
661-
# In setuid mode, supervised processes may run as a uid different
662-
# from the test user and still need to traverse Bazel output paths.
663-
ensure_path_traversable_for_sandbox(Path.home())
664-
ensure_path_traversable_for_sandbox(Path.home() / ".cache" / "bazel")
658+
# NOTE: Supervised processes may run as a uid different from the test user.
659+
# If Bazel outputs are under your home directory and it lacks o+x permissions,
660+
# those processes will fail to traverse paths. To avoid modifying your home
661+
# directory permissions automatically, ensure it is already traversable (o+x)
662+
# or configure Bazel to use an output directory outside your home.
663+
# Test workspace directories are made traversable below.
665664

666665
if os.geteuid() != 0:
667666
subprocess.run(["sudo", "-v"], check=True, timeout=30)

0 commit comments

Comments
 (0)