diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java b/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java index d069f90783123e..cadf05f1e50848 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java @@ -380,7 +380,7 @@ public String getTypeDescription() { @Option( name = "experimental_forward_instrumented_files_info_by_default", - defaultValue = "false", + defaultValue = "true", documentationCategory = OptionDocumentationCategory.OUTPUT_PARAMETERS, effectTags = {OptionEffectTag.AFFECTS_OUTPUTS}, help = diff --git a/src/test/java/com/google/devtools/build/lib/analysis/AspectTest.java b/src/test/java/com/google/devtools/build/lib/analysis/AspectTest.java index ea8376edf81b8f..e39c708f550115 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/AspectTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/AspectTest.java @@ -1117,7 +1117,7 @@ public void instrumentedFilesInfoFromBaseRuleAndAspectUsesAspect() throws Except .containsExactly("a"); assertThat(getInstrumentedFiles("//aspect:instrumented_file_info_from_base_target")) .containsExactly("b"); - assertThat(getInstrumentedFilesInfo("//aspect:rule_target_no_coverage")).isNull(); + assertThat(getInstrumentedFiles("//aspect:rule_target_no_coverage")).isEmpty(); assertThat(getInstrumentedFiles("//aspect:instrumented_files_info_only_from_aspect")) .containsExactly("a"); assertThat(getInstrumentedFiles("//aspect:no_instrumented_files_info")).isEmpty(); @@ -1125,10 +1125,8 @@ public void instrumentedFilesInfoFromBaseRuleAndAspectUsesAspect() throws Except private List getInstrumentedFiles(String label) throws InterruptedException { return ActionsTestUtil.baseArtifactNames( - getInstrumentedFilesInfo(label).getInstrumentedFiles()); - } - - private InstrumentedFilesInfo getInstrumentedFilesInfo(String label) throws InterruptedException { - return getConfiguredTarget(label).get(InstrumentedFilesInfo.STARLARK_CONSTRUCTOR); + getConfiguredTarget(label) + .get(InstrumentedFilesInfo.STARLARK_CONSTRUCTOR) + .getInstrumentedFiles()); } } diff --git a/src/test/java/com/google/devtools/build/lib/starlark/StarlarkIntegrationTest.java b/src/test/java/com/google/devtools/build/lib/starlark/StarlarkIntegrationTest.java index f4a7bfeb079077..de178ce59be863 100644 --- a/src/test/java/com/google/devtools/build/lib/starlark/StarlarkIntegrationTest.java +++ b/src/test/java/com/google/devtools/build/lib/starlark/StarlarkIntegrationTest.java @@ -941,8 +941,10 @@ public void testInstrumentedFilesForwardedFromDepsByDefaultExperimentFlag() thro // Current behavior is that nothing gets forwarded if IntstrumentedFilesInfo is not configured. // That means that source files are not collected for the coverage manifest unless the entire // dependency chain between the test and the source file explicitly configures coverage. - // New behavior is protected by --experimental_forward_instrumented_files_info_by_default. - useConfiguration("--collect_code_coverage"); + // New behavior is controlled by --experimental_forward_instrumented_files_info_by_default, + // which is now on by default. + useConfiguration( + "--collect_code_coverage", "--noexperimental_forward_instrumented_files_info_by_default"); ConfiguredTarget target = getConfiguredTarget("//test/starlark:outer"); InstrumentedFilesInfo provider = target.get(InstrumentedFilesInfo.STARLARK_CONSTRUCTOR); assertWithMessage("InstrumentedFilesInfo should be set.").that(provider).isNotNull(); @@ -952,8 +954,7 @@ public void testInstrumentedFilesForwardedFromDepsByDefaultExperimentFlag() thro // dependencies. Coverage still needs to be configured for rules that handle source files for // languages which support coverage instrumentation, but not every wrapper rule in the // dependency chain needs to configure that for instrumentation to be correct. - useConfiguration( - "--collect_code_coverage", "--experimental_forward_instrumented_files_info_by_default"); + useConfiguration("--collect_code_coverage"); target = getConfiguredTarget("//test/starlark:outer"); provider = target.get(InstrumentedFilesInfo.STARLARK_CONSTRUCTOR); assertWithMessage("InstrumentedFilesInfo should be set.").that(provider).isNotNull();