-
Notifications
You must be signed in to change notification settings - Fork 615
CI testing - ignore #2086
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
CI testing - ignore #2086
Changes from 4 commits
2dad613
0a73e18
6ee934c
e7dbd9e
ef0af67
26c3cb1
c0a5f90
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,19 +13,32 @@ | |
| # limitations under the License. | ||
|
|
||
| import os | ||
| from pathlib import Path | ||
| import signal | ||
| import subprocess | ||
| import sys | ||
| import tempfile | ||
| import time | ||
| from typing import IO | ||
|
|
||
| # Blueprint stdio is written under this directory; the CI workflow cats it | ||
| # on failure since pytest's captured output is lost when --timeout-method=thread | ||
| # forces os._exit(). | ||
| LOG_DIR = Path(os.environ.get("DIMOS_E2E_LOG_DIR", tempfile.gettempdir())) / "dimos-e2e-logs" | ||
|
|
||
|
|
||
| class DimosCliCall: | ||
| process: subprocess.Popen[bytes] | None | ||
| demo_args: list[str] | None = None | ||
| mcp_port: int | None = None | ||
| simulator: str = "mujoco" | ||
| log_path: Path | None | ||
| _log_file: IO[bytes] | None | ||
|
|
||
| def __init__(self) -> None: | ||
| self.process = None | ||
| self.log_path = None | ||
| self._log_file = None | ||
|
|
||
| def start(self) -> None: | ||
| if self.demo_args is None: | ||
|
|
@@ -48,6 +61,19 @@ def start(self) -> None: | |
| f"mcpclient.mcp_server_url=http://localhost:{self.mcp_port}/mcp", | ||
| ] | ||
|
|
||
| LOG_DIR.mkdir(parents=True, exist_ok=True) | ||
| fd, log_path_str = tempfile.mkstemp(prefix="blueprint-", suffix=".log", dir=str(LOG_DIR)) | ||
| os.close(fd) | ||
| self.log_path = Path(log_path_str) | ||
| self._log_file = open(self.log_path, "wb") | ||
| # Print before spawn so the path is in the test log even if the test | ||
| # later os._exit()s on pytest-timeout. | ||
| print(f"[dimos blueprint] stdio -> {self.log_path}", file=sys.stderr, flush=True) | ||
|
|
||
| # Force unbuffered Python output in the subprocess so we get lines as | ||
| # they happen rather than at process exit. | ||
| env = {**os.environ, "PYTHONUNBUFFERED": "1"} | ||
|
|
||
| self.process = subprocess.Popen( | ||
| [ | ||
| "dimos", | ||
|
|
@@ -57,9 +83,28 @@ def start(self) -> None: | |
| *args, | ||
| *blueprint_overrides, | ||
| ], | ||
| stdout=self._log_file, | ||
| stderr=subprocess.STDOUT, | ||
| env=env, | ||
| start_new_session=True, | ||
| ) | ||
|
|
||
| def check_alive(self) -> None: | ||
| """Raise if the dimos subprocess has exited. | ||
|
|
||
| Tests block waiting for LCM topics from the blueprint; without this | ||
| an early crash (missing API key, module init failure) just looks like | ||
| a 20-minute hang. | ||
| """ | ||
| if self.process is None: | ||
| return | ||
| rc = self.process.poll() | ||
| if rc is not None: | ||
| raise RuntimeError( | ||
| f"dimos blueprint subprocess exited early with code {rc}. " | ||
| f"See {self.log_path} for output." | ||
| ) | ||
|
|
||
| def stop(self) -> None: | ||
| if self.process is None: | ||
| return | ||
|
|
@@ -99,3 +144,31 @@ def stop(self) -> None: | |
| pass | ||
| self.process.wait() | ||
| raise | ||
| finally: | ||
| self._dump_log() | ||
|
Comment on lines
108
to
+148
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| def _dump_log(self) -> None: | ||
| if self._log_file is not None: | ||
| try: | ||
| self._log_file.close() | ||
| except Exception: | ||
| pass | ||
| self._log_file = None | ||
| if self.log_path is None or not self.log_path.exists(): | ||
| return | ||
| try: | ||
| content = self.log_path.read_text(errors="replace") | ||
| except OSError: | ||
| return | ||
| if not content.strip(): | ||
| return | ||
| # Dump to stderr so pytest's "Captured stderr" includes it on failure. | ||
| # The on-disk copy at log_path remains for CI to cat after job timeout. | ||
| print( | ||
| f"\n--- dimos blueprint output ({self.log_path}) ---", | ||
| file=sys.stderr, | ||
| flush=True, | ||
| ) | ||
| sys.stderr.write(content) | ||
| sys.stderr.write("\n--- end dimos blueprint output ---\n") | ||
| sys.stderr.flush() | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if: falsepermanently disables all CI testsThe
testsjob carriesif: false, which makes GitHub Actions skip it unconditionally. If this PR is merged tomainwithout removing this line, every unit/integration/e2e test in the matrix (all Python versions, the ROS self-hosted runner, etc.) will be silently skipped on every future commit. The PR title hints this is intentional for in-flight testing, but the line must not land on the base branch.