test(issue-28): make the host-dependent tests portable; POSIX ps in the process scanners

The 33 failures on the Linux / Python 3.14 host (#28) were environment
dependencies, not regressions; each test is worth keeping, so fix the
dependency instead of deleting the test:

- test_workspace_scope: `source` under `shell=True` ran in dash; run the
  command string under bash.
- conftest autouse: MAM_ENV_FILE points at an absent file for every test,
  so a workspace .mam.env with a reachable broker no longer breaks the
  "broker unavailable" tests (T1-4).
- help-capture guard: compare normalized help text (whitespace collapsed,
  "optional arguments"/"options" unified) so argparse re-wrapping across
  Python versions is not drift.
- deploy freshness D-11..D-19 and D-22..D-30: skip with a reason when the
  nats-docker submodule is not initialized.
- lib_py.agents.base.conversation_in_use and heartbeat._process_table:
  `ps -eo pid=,ppid=,args=` (POSIX) instead of the BSD `-axo ... command=`
  form, the most likely cause of the 12 purge failures on Linux (the holder
  scan returned nothing); to be confirmed on that host.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VCgu9Fa9iT7TbJUSzdq4Ff
This commit is contained in:
GodopuandClaude Fable 5.1 committed 2026-09-20 19:15:50 +09:00
1 parent 46ea4cc1e4
commit 7a94ba2c3e
6 files changed
+48 -4

No files matched your search

+11 -1
View File
@@ -497,6 +497,11 @@ def test_importing_delegation_does_not_mutate_environment(mam_sandbox):
assert set(os.environ) == keys
def _normalize_help(text: str) -> str:
text = text.replace("optional arguments:", "options:")
return re.sub(r"\s+", " ", text).strip()
def test_shim_help_output_matches_pre_move_capture():
"""The shim must be indistinguishable from the implementation at the CLI.
@@ -512,7 +517,12 @@ def test_shim_help_output_matches_pre_move_capture():
capture_output=True, text=True, timeout=60,
)
assert res.returncode == 0, res.stderr
assert res.stdout + res.stderr == golden, "--help drifted for {}".format(mod)
# argparse re-wraps usage/help text and renamed the "optional arguments"
# group across Python versions (Issue #28: the captures were taken on
# 3.9, the Linux host runs 3.14). Compare the content, not the layout:
# whitespace runs collapsed, the group label unified.
assert _normalize_help(res.stdout + res.stderr) == _normalize_help(golden), \
"--help drifted for {}".format(mod)
# --- PV-4: the context matrix, each scenario in a fresh interpreter ------------