[PR #2226] [MERGED] test(adb): isolate cross-platform activity launch regressions #5098

Closed
opened 2026-10-31 01:03:54 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2226
Author: @dakjdakd
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @morluto

Base: main ← Head: fix/adb-start-timeout


📝 Commits (4)

  • 18c82f6 fix(adb): reject timed-out activity launches and retain observations
  • aed6808 merge: reconcile activity launch fix with upstream implementation
  • eb4db05 test(adb): isolate cross-platform activity launch regressions
  • 19dfd98 fix(adb): merge main with updated activity launch regressions

📊 Changes

1 file changed (+147 additions, -0 deletions)

View changed files

➕ tests/process-global/adbStartMcp.test.ts (+147 -0)

📄 Description

Refs #2225

Problem and current scope

Activity Manager can print a Starting: intent before subsequently reporting Status: timeout or a hard error. The launch report must be interpreted as a whole, and unsuccessful attempts must retain their command output and partial launch facts.

The implementation of that correction is now on main in c89972c877. This branch merges the current upstream implementation and keeps its parser, provider, contracts, and mock-free MCP subprocess tests. The remaining diff adds cross-platform MCP regression coverage in the existing isolated process-global test project.

Why the test belongs in the isolated project

The deterministic test replaces execFileOutput and execFileBytes. The mcp-boundary project shares its module graph between files with isolate: false; resetting mock function state does not reload a previously imported provider or remove module replacements from that shared graph. These tests need per-file module isolation to keep their process replacements scoped to the test file.

tests/process-global/adbStartMcp.test.ts now owns that deterministic coverage. Its existing Vitest project runs isolated forks. The test's imports were adjusted for the new location; no shared project settings or production process behavior change.

Observable behavior covered

Both start_adb_app and start_adb_activity run through the real provider, session service, MCP server, and in-memory SDK client. Only the process output boundary is simulated. Each operation checks:

  • A successful report returns observed Evidence with the attempted intent, reported activity/status, and both raw output streams.
  • A later device-reported timeout returns an MCP error with the raw streams and typed partial launch facts, rather than successful Evidence.
  • A hard error after an attempted launch also returns an MCP error.
  • All three requests use the existing fixed am start -W argument construction for the selected tool.

The mock-free executable tests remain under tests/boundary/mcp/adbStartMcp.test.ts. They provide subprocess-boundary coverage on supported hosts. The isolated deterministic cases also run on Windows, where that POSIX executable fixture is skipped.

Validation

Using the pinned Node.js 24.18.0 and npm 11.16.0 toolchain on Windows:

npm run test:focused -- src/adb/AdbShellOutput.test.ts src/adb/AdbProvider.test.ts src/domain/adb/adbDeviceAnalysis.test.ts tests/process-global/adbStartMcp.test.ts tests/boundary/mcp/adbStartMcp.test.ts tests/boundary/mcp/adbMcp.test.ts

Four suites passed, with nine tests passed. The provider executable cases and the POSIX MCP fixture were skipped on Windows; the two isolated app/activity regressions both ran and passed.

npm run check and npm run verify:test-discovery passed. Discovery includes the new isolated file exactly once.

Compatibility and verification boundary

The remaining changes are tests only. They add no public fields, dependencies, execution authority, or device mutations. Simulated process output establishes provider-to-MCP behavior, not live Android lifecycle behavior; no live device verification is claimed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/2226 **Author:** [@dakjdakd](https://github.com/dakjdakd) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/adb-start-timeout` --- ### 📝 Commits (4) - [`18c82f6`](https://github.com/morluto/rea/commit/18c82f610eb63b5f1a14c18b89333befbc5f438a) fix(adb): reject timed-out activity launches and retain observations - [`aed6808`](https://github.com/morluto/rea/commit/aed680810aaacbf55d7a75d1959437b347302d0a) merge: reconcile activity launch fix with upstream implementation - [`eb4db05`](https://github.com/morluto/rea/commit/eb4db059b0259ff9f050efe0470741d43d5d6153) test(adb): isolate cross-platform activity launch regressions - [`19dfd98`](https://github.com/morluto/rea/commit/19dfd9817a76f080e481d6f74d056fbea9a4f617) fix(adb): merge main with updated activity launch regressions ### 📊 Changes **1 file changed** (+147 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `tests/process-global/adbStartMcp.test.ts` (+147 -0) </details> ### 📄 Description Refs #2225 ## Problem and current scope Activity Manager can print a `Starting:` intent before subsequently reporting `Status: timeout` or a hard error. The launch report must be interpreted as a whole, and unsuccessful attempts must retain their command output and partial launch facts. The implementation of that correction is now on `main` in c89972c8777d0114566fe76a060849a18bdd2659. This branch merges the current upstream implementation and keeps its parser, provider, contracts, and mock-free MCP subprocess tests. The remaining diff adds cross-platform MCP regression coverage in the existing isolated `process-global` test project. ## Why the test belongs in the isolated project The deterministic test replaces `execFileOutput` and `execFileBytes`. The `mcp-boundary` project shares its module graph between files with `isolate: false`; resetting mock function state does not reload a previously imported provider or remove module replacements from that shared graph. These tests need per-file module isolation to keep their process replacements scoped to the test file. `tests/process-global/adbStartMcp.test.ts` now owns that deterministic coverage. Its existing Vitest project runs isolated forks. The test's imports were adjusted for the new location; no shared project settings or production process behavior change. ## Observable behavior covered Both `start_adb_app` and `start_adb_activity` run through the real provider, session service, MCP server, and in-memory SDK client. Only the process output boundary is simulated. Each operation checks: - A successful report returns observed Evidence with the attempted intent, reported activity/status, and both raw output streams. - A later device-reported timeout returns an MCP error with the raw streams and typed partial launch facts, rather than successful Evidence. - A hard error after an attempted launch also returns an MCP error. - All three requests use the existing fixed `am start -W` argument construction for the selected tool. The mock-free executable tests remain under `tests/boundary/mcp/adbStartMcp.test.ts`. They provide subprocess-boundary coverage on supported hosts. The isolated deterministic cases also run on Windows, where that POSIX executable fixture is skipped. ## Validation Using the pinned Node.js 24.18.0 and npm 11.16.0 toolchain on Windows: ```shell npm run test:focused -- src/adb/AdbShellOutput.test.ts src/adb/AdbProvider.test.ts src/domain/adb/adbDeviceAnalysis.test.ts tests/process-global/adbStartMcp.test.ts tests/boundary/mcp/adbStartMcp.test.ts tests/boundary/mcp/adbMcp.test.ts ``` Four suites passed, with nine tests passed. The provider executable cases and the POSIX MCP fixture were skipped on Windows; the two isolated app/activity regressions both ran and passed. `npm run check` and `npm run verify:test-discovery` passed. Discovery includes the new isolated file exactly once. ## Compatibility and verification boundary The remaining changes are tests only. They add no public fields, dependencies, execution authority, or device mutations. Simulated process output establishes provider-to-MCP behavior, not live Android lifecycle behavior; no live device verification is claimed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:03:54 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5098
No description provided.