Buck: android_instrumentation_test()

android_instrumentation_test()

This is liable to change in the future.

A android_instrumentation_test() rule is used to define apks that should be used to run Android instrumentation tests.

Arguments

  • name (required) #

    The name of the rule.

  • apk (required) #

    The APK containing the tests. Can be an android_binary, an apk_genrule or an android_instrumentation_apk.

  • labels (defaults to []) #

    A list of labels to be applied to these tests. These labels are arbitrary text strings and have no meaning within buck itself. They can, however, have meaning for you as a test author (e.g., smoke or fast). A label can be used to filter or include a specific test rule when executing buck test.

  • test_rule_timeout_ms (defaults to None) #

    If set specifies the maximum amount of time (in milliseconds) in which all of the tests in this rule should complete. This overrides the default rule_timeout if any has been specified in test.rule_timeout.

  • visibility (defaults to []) #

    List of build target patterns that identify the build rules that can include this rule in its deps.

  • licenses (defaults to []) #

    Set of license files for this library. To get the list of license files for a given build rule and all of its dependencies, you can use buck query.

  • labels (defaults to []) #

    Set of arbitrary strings which allow you to annotate a build rule with tags that can be searched for over an entire dependency tree using buck query attrfilter.

Examples

Here is an example of an android_instrumentation_test() rule that tests an android_binary().
android_binary(
  name = 'messenger',
  manifest = 'AndroidManifest.xml',
  keystore = '//keystores:prod',
  package_type = 'release',
  proguard_config = 'proguard.cfg',
  deps = [
    ...
  ],
)

android_instrumentation_apk(
  name = 'messenger_test',
  manifest = 'AndroidInstrumentationManifest.xml',
  apk = ':messenger',
  deps = [
    ...
  ],
)

android_instrumentation_test(
  name = 'messenger_instrumentation_test',
  apk = ':messenger_test',
)