[GH-ISSUE #2064] AdbProvider tests fail on main after the shared shell stub and directory listing changed #684

Closed
opened 2026-10-15 18:27:22 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @kaoru0822-kitauji on GitHub (Oct 12, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/2064

Observed behavior

Since 3bdc8730b (fix(adb): preserve directory identities and share byte capture), three tests in src/adb/AdbProvider.test.ts fail on main, both locally and in main CI (run for 3bdc8730b, Test shard (1/4)):

  • reads a bounded logcat dump with the caller count and buffer: 1 line instead of 2.
  • resolves packages by case-insensitive substring: no matches.
  • quotes caller text before adb joins the remote shell command: ENOENT … /observed.

Cause

These are stale tests, not product regressions.

  1. The commit changed the shared shellStub helper to escape backslashes before printf '%b', so fixtures can carry exact bytes. The logcat and pm list fixtures still spell line breaks as \\n and relied on %b turning them into newlines. They now emit a literal \n, and the dump collapses into one line.
  2. list_adb_directory now runs sh -c 'cd "$1" … find … -exec sh -c "$2" …' rea-list-directory <device_path> <script> instead of ls <device_path>. The quoting test models the device with a fake ls that records its arguments. The new command never calls ls, so nothing is recorded, and the test no longer checks the quoting property it is named for.

Expected behavior

The fixtures use real line breaks. The quoting regression observes the remote command list_adb_directory actually runs, and still proves that caller text reaches the device shell as one intact argument and cannot inject a command.

Originally created by @kaoru0822-kitauji on GitHub (Oct 12, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/2064 ## Observed behavior Since 3bdc8730b (`fix(adb): preserve directory identities and share byte capture`), three tests in `src/adb/AdbProvider.test.ts` fail on main, both locally and in main CI (run for 3bdc8730b, `Test shard (1/4)`): - `reads a bounded logcat dump with the caller count and buffer`: 1 line instead of 2. - `resolves packages by case-insensitive substring`: no matches. - `quotes caller text before adb joins the remote shell command`: `ENOENT … /observed`. ## Cause These are stale tests, not product regressions. 1. The commit changed the shared `shellStub` helper to escape backslashes before `printf '%b'`, so fixtures can carry exact bytes. The logcat and `pm list` fixtures still spell line breaks as `\\n` and relied on `%b` turning them into newlines. They now emit a literal `\n`, and the dump collapses into one line. 2. `list_adb_directory` now runs `sh -c 'cd "$1" … find … -exec sh -c "$2" …' rea-list-directory <device_path> <script>` instead of `ls <device_path>`. The quoting test models the device with a fake `ls` that records its arguments. The new command never calls `ls`, so nothing is recorded, and the test no longer checks the quoting property it is named for. ## Expected behavior The fixtures use real line breaks. The quoting regression observes the remote command `list_adb_directory` actually runs, and still proves that caller text reaches the device shell as one intact argument and cannot inject a command.
bsakaguchi 2026-10-15 18:27:22 +00:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@kaoru0822-kitauji commented on GitHub (Oct 12, 2026):

Fixed on main by 4573e8cf3. The three AdbProvider tests pass there (45/45), and the quoting regression again exercises list_adb_directory with hostile path text. Closing #2066 as superseded.

<!-- gh-comment-id:6119404361 --> @kaoru0822-kitauji commented on GitHub (Oct 12, 2026): Fixed on main by 4573e8cf3. The three `AdbProvider` tests pass there (45/45), and the quoting regression again exercises `list_adb_directory` with hostile path text. Closing #2066 as superseded.
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#684
No description provided.