Skip to content

Commit

Permalink
Make buck2 run for instrumentation test work
Browse files Browse the repository at this point in the history
Summary: Its annoying that buck run <instrumentation test> does not work, this is because the test runner assumes more args that tpx adds, this adds sane defaults to the RunInfo so that it runs.

Reviewed By: IanChilds

Differential Revision: D57138353

fbshipit-source-id: f5fff6813689d51a341920541891e21e95f2ab2e
  • Loading branch information
vener91 authored and facebook-github-bot committed May 9, 2024
1 parent c4f7f86 commit 8b3fedd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion android/android_instrumentation_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,13 @@ def android_instrumentation_test_impl(ctx: AnalysisContext):

classmap_source_info = [ctx.attrs.apk[JavaClassToSourceMapInfo]] if JavaClassToSourceMapInfo in ctx.attrs.apk else []

return inject_test_run_info(ctx, test_info) + [
test_info, run_info = inject_test_run_info(ctx, test_info)

# We append additional args so that "buck2 run" will work with sane defaults
run_info.args.add(cmd_args(["--auto-run-on-connected-device", "--output", ".", "--adb-executable-path", "adb"]))
return [
test_info,
run_info,
DefaultInfo(),
] + classmap_source_info

Expand Down

0 comments on commit 8b3fedd

Please sign in to comment.