test-infra: make local_instrumented.sh CWD-independent #287

Merged
JMR-dev merged 2 commits from test-infra-284-helper-cwd into main 2026-07-04 05:58:58 +00:00
2 Commits
Author SHA1 Message Date
Jason Ross 6ff43c1035 Merge main into test-infra-284-helper-cwd 2026-07-04 00:38:28 -05:00
JMR-devandClaude Opus 4.8 0b67cb952a fix(test-infra): make local_instrumented.sh CWD-independent
The wrapper jar path was resolved from the script's own location, but
gradlew picks the *project* to build from the process's current
directory, not from its own script location. Invoking the helper from
a CWD outside its tree (e.g. another worktree) silently built the
wrong repo's :app, once observed as a ClassNotFoundException for a
test class that only existed in the intended worktree.

cd to the already-resolved repo/worktree root before invoking gradlew
so connectedDebugAndroidTest always targets the correct tree
regardless of the caller's CWD. Update the README's usage note to
match.

Closes #284

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-04 00:22:24 -05:00