Remove log_levels attribute from android_instrumentation_test. This can be encapsulated in a device script fixture as an environment variable. https://developer.android.com/studio/command-line/logcat.html#filteringOutput RELNOTES: None. PiperOrigin-RevId: 184683289
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTest.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTest.java index 440aa7e..f2ec7219 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTest.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTest.java
@@ -128,7 +128,6 @@ .add(artifactSubstitution("%instrumentation_apk%", getInstrumentationApk(ruleContext))) .add(artifactListSubstitution("%support_apks%", getAllSupportApks(ruleContext))) .add(Substitution.ofSpaceSeparatedMap("%fixture_args%", getFixtureArgs(ruleContext))) - .add(Substitution.ofSpaceSeparatedMap("%log_levels%", getLogLevels(ruleContext))) .add(deviceScriptFixturesSubstitution(ruleContext)) .addAll(hostServiceFixturesSubstitutions(ruleContext)) .add(artifactListSubstitution("%data_deps%", getDataDeps(ruleContext))) @@ -262,11 +261,6 @@ return ImmutableMap.copyOf(ruleContext.attributes().get("fixture_args", Type.STRING_DICT)); } - /** Map of {@code log_levels} to enable before the test run. */ - private static ImmutableMap<String, String> getLogLevels(RuleContext ruleContext) { - return ImmutableMap.copyOf(ruleContext.attributes().get("log_levels", Type.STRING_DICT)); - } - private static ImmutableList<Artifact> getDataDeps(RuleContext ruleContext) { return ruleContext.getPrerequisiteArtifacts("data", Mode.DATA).list(); }
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTestRule.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTestRule.java index db632ee..13043de 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTestRule.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidInstrumentationTestRule.java
@@ -56,7 +56,6 @@ .allowedRuleClasses( "android_device_script_fixture", "android_host_service_fixture")) .add(attr("fixture_args", STRING_DICT)) - .add(attr("log_levels", STRING_DICT)) .add( attr("$test_entry_point", LABEL) .exec()
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/android_instrumentation_test_template.txt b/src/main/java/com/google/devtools/build/lib/rules/android/android_instrumentation_test_template.txt index 5278009..0219d16 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/android_instrumentation_test_template.txt +++ b/src/main/java/com/google/devtools/build/lib/rules/android/android_instrumentation_test_template.txt
@@ -41,7 +41,6 @@ test_label="%test_label%" test_entry_point="%test_entry_point%" -log_levels="%log_levels%" WORKSPACE_DIR="${TEST_SRCDIR}/%workspace%" adb="${WORKSPACE_DIR}/%adb%" aapt="${WORKSPACE_DIR}/%aapt%"