test-infra: port local dev scripts to Python (cross-platform) + rewire preflight off GMD #281

Closed
opened 2026-07-04 03:59:28 +00:00 by JMR-dev · 0 comments
JMR-dev commented 2026-07-04 03:59:28 +00:00 (Migrated from github.com)

Convention (maintainer rule, 2026-07-04): development & utility scripts should be written in Python wherever practical, to stay cross-platform (Windows / macOS / Linux). Do not introduce new bash-only (.sh) or PowerShell-only dev scripts. Rationale: the primary dev machine is Windows, where bash-only helpers require Git Bash and hit portability gaps (jq not installed, taskkill vs kill, path/quoting differences — all encountered in practice). Python is already the precedent: .claude/hooks/check-spdx.py, .claude/skills/preflight/api37_e2e.py. (Scope = auxiliary scripts only — product code stays Kotlin, Gradle stays Kotlin DSL.)

Scope of this ticket:

  1. Convert .claude/skills/preflight/local_instrumented.sh → local_instrumented.py — the last bash holdout. Port the manual cold-boot + targeted connectedDebugAndroidTest + orphan-kill/teardown hygiene to Python (stdlib subprocess; the emulator/adb orphan-kill must work on Windows and *nix — taskkill/kill abstracted). Preserve the CLI (comma-separated test-class arg) and the EXIT-trap teardown so it self-cleans even if the caller stops. Update local_instrumented.README.md.
  2. Rewire preflight (original scope): swap preflight's local api35DebugAndroidTest / api36DebugAndroidTest steps (GMD — snapshot-fails locally under AEHD 2.2) to invoke the new local_instrumented.py, so preflight no longer hits the GMD failure locally.
  3. Document the convention in CLAUDE.md — a short "Dev scripts: prefer Python for cross-platform portability" note under the build/test section.
  4. Going-forward: any new util/CI-helper script starts in Python.

Original context retained: follow-up to #269 (PR #280 shipped the local_instrumented.sh helper — manual cold-boot + orphan-kill/teardown hygiene). #269's DoD wanted preflight's local api35/api36 E2E rewired off GMD; #280 shipped the primitive but preflight's SKILL.md steps still call the GMD tasks. Review the approach before implementing (touches the local merge-gate). Not blocking.

**Convention (maintainer rule, 2026-07-04):** development & utility scripts should be written in **Python wherever practical**, to stay **cross-platform** (Windows / macOS / Linux). Do not introduce new bash-only (`.sh`) or PowerShell-only dev scripts. Rationale: the primary dev machine is Windows, where bash-only helpers require Git Bash and hit portability gaps (`jq` not installed, `taskkill` vs `kill`, path/quoting differences — all encountered in practice). Python is already the precedent: `.claude/hooks/check-spdx.py`, `.claude/skills/preflight/api37_e2e.py`. (Scope = auxiliary scripts only — product code stays Kotlin, Gradle stays Kotlin DSL.) **Scope of this ticket:** 1. **Convert `.claude/skills/preflight/local_instrumented.sh` → `local_instrumented.py`** — the last bash holdout. Port the manual cold-boot + targeted `connectedDebugAndroidTest` + orphan-kill/teardown hygiene to Python (stdlib `subprocess`; the emulator/adb orphan-kill must work on Windows *and* *nix — `taskkill`/`kill` abstracted). Preserve the CLI (comma-separated test-class arg) and the EXIT-trap teardown so it self-cleans even if the caller stops. Update `local_instrumented.README.md`. 2. **Rewire preflight** (original scope): swap preflight's local `api35DebugAndroidTest` / `api36DebugAndroidTest` steps (GMD — snapshot-fails locally under AEHD 2.2) to invoke the new `local_instrumented.py`, so preflight no longer hits the GMD failure locally. 3. **Document the convention in `CLAUDE.md`** — a short "Dev scripts: prefer Python for cross-platform portability" note under the build/test section. 4. Going-forward: any new util/CI-helper script starts in Python. --- _Original context retained:_ follow-up to #269 (PR #280 shipped the `local_instrumented.sh` helper — manual cold-boot + orphan-kill/teardown hygiene). #269's DoD wanted preflight's local api35/api36 E2E rewired off GMD; #280 shipped the primitive but preflight's SKILL.md steps still call the GMD tasks. Review the approach before implementing (touches the local merge-gate). Not blocking.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: JMR-dev/LibreMail#281