Skip to content

Commit 0b45ed8

Browse files
committed
fixxing the python build issues
1 parent 74af57f commit 0b45ed8

4 files changed

Lines changed: 12 additions & 29 deletions

File tree

feature_integration_tests/test_cases/conftest.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,7 @@ def pytest_addoption(parser):
6666
"--bazel-config",
6767
type=str,
6868
default=os.environ.get("FIT_BAZEL_CONFIG", "linux-x86_64"),
69-
help=(
70-
"Bazel config used when --build-scenarios is enabled "
71-
'(default: env FIT_BAZEL_CONFIG or "linux-x86_64").'
72-
),
69+
help=('Bazel config used when --build-scenarios is enabled (default: env FIT_BAZEL_CONFIG or "linux-x86_64").'),
7370
)
7471
parser.addoption(
7572
"--default-execution-timeout",

feature_integration_tests/test_cases/daemon_helpers.py

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -134,19 +134,12 @@ def get_binary_path(target: str, version: str = "rust") -> Path:
134134
if build_res.returncode != 0:
135135
stderr_tail = "\n".join(build_res.stderr.strip().splitlines()[-20:])
136136
raise RuntimeError(
137-
"Failed to build target "
138-
f"{target!r} with --config={bazel_config}.\n"
139-
f"stderr (last lines):\n{stderr_tail}"
137+
f"Failed to build target {target!r} with --config={bazel_config}.\nstderr (last lines):\n{stderr_tail}"
140138
)
141139

142-
ws_info_res = subprocess.run(
143-
["bazel", "info", "workspace"], capture_output=True, text=True, check=False
144-
)
140+
ws_info_res = subprocess.run(["bazel", "info", "workspace"], capture_output=True, text=True, check=False)
145141
if ws_info_res.returncode != 0:
146-
raise RuntimeError(
147-
"Failed to resolve Bazel workspace path.\n"
148-
f"stderr:\n{ws_info_res.stderr.strip()}"
149-
)
142+
raise RuntimeError(f"Failed to resolve Bazel workspace path.\nstderr:\n{ws_info_res.stderr.strip()}")
150143

151144
cquery_cmd = [
152145
"bazel",
@@ -159,8 +152,7 @@ def get_binary_path(target: str, version: str = "rust") -> Path:
159152
cquery_res = subprocess.run(cquery_cmd, capture_output=True, text=True, check=False)
160153
if cquery_res.returncode != 0:
161154
raise RuntimeError(
162-
"Failed to locate built executable with Bazel cquery.\n"
163-
f"stderr:\n{cquery_res.stderr.strip()}"
155+
f"Failed to locate built executable with Bazel cquery.\nstderr:\n{cquery_res.stderr.strip()}"
164156
)
165157

166158
ws_path = Path(ws_info_res.stdout.strip())
@@ -191,9 +183,7 @@ def copy_flatbuffer_daemon_configs(etc_dir: Path) -> None:
191183
f"stderr (last lines):\n{stderr_tail}"
192184
)
193185

194-
ws_info_res = subprocess.run(
195-
["bazel", "info", "workspace"], capture_output=True, text=True, check=False
196-
)
186+
ws_info_res = subprocess.run(["bazel", "info", "workspace"], capture_output=True, text=True, check=False)
197187
if ws_info_res.returncode != 0:
198188
raise RuntimeError(
199189
"Failed to resolve Bazel workspace path while locating flatbuffer configs.\n"
@@ -286,9 +276,7 @@ def start(self, startup_timeout: float = 2.0) -> None:
286276
log_content = self.log_file.read_text() if self.log_file.exists() else "No logs available"
287277
self._close_log_fd()
288278
self.process = None
289-
raise RuntimeError(
290-
f"Launch Manager daemon failed to start. Exit code: {return_code}\nLogs:\n{log_content}"
291-
)
279+
raise RuntimeError(f"Launch Manager daemon failed to start. Exit code: {return_code}\nLogs:\n{log_content}")
292280

293281
def stop(self, shutdown_timeout: float = 5.0) -> None:
294282
"""

feature_integration_tests/test_cases/tests/lifecycle/test_process_launching_with_daemon.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,12 @@ def test_supervised_app_recovery(
230230
else:
231231
logs = daemon.get_logs()
232232
recovery_signals = [
233-
f"unexpected termination of process" ,
233+
f"unexpected termination of process",
234234
"Activating Recovery state.",
235235
f"Got kRunning timeout for process",
236236
]
237237
assert any(signal in logs for signal in recovery_signals), (
238-
f"Supervised app {app_name} not running and no recovery diagnostics found."
239-
f"\nDaemon logs:\n{logs}"
238+
f"Supervised app {app_name} not running and no recovery diagnostics found.\nDaemon logs:\n{logs}"
240239
)
241240

242241
except subprocess.CalledProcessError as e:

feature_integration_tests/test_cases/tests/lifecycle/test_run_targets.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,9 @@ def test_run_target_switch(self, results: ScenarioResult, logs_info_level: LogCo
9494
assert results.return_code == ResultCode.SUCCESS
9595

9696
if version == "cpp":
97-
assert (
98-
"Switching from startup to running" in results.stdout
99-
or "Switching run targets" in results.stdout
100-
), "Run target switch failed"
97+
assert "Switching from startup to running" in results.stdout or "Switching run targets" in results.stdout, (
98+
"Run target switch failed"
99+
)
101100
else:
102101
switch_logs = logs_info_level.get_logs(field="message", pattern="Switching run targets")
103102
assert len(switch_logs) > 0, "Run target switch failed"

0 commit comments

Comments
 (0)