Skip to content

Commit

Permalink
exec transition should not reset any TestConfiguration.TestOptions op…
Browse files Browse the repository at this point in the history
…tions

PiperOrigin-RevId: 459365627
Change-Id: I5b0906154b2efc708be70b3658f50459165a1ee7
  • Loading branch information
sdtwigg authored and Copybara-Service committed Jul 6, 2022
1 parent 2b44482 commit 2adf003
Showing 1 changed file with 8 additions and 10 deletions.
Expand Up @@ -296,16 +296,14 @@ public static class TestOptions extends FragmentOptions {

@Override
public FragmentOptions getHost() {
TestOptions hostOptions = (TestOptions) getDefault();
// These fields are used in late-bound attributes, which must not be null in the host
// configuration.
hostOptions.coverageSupport = this.coverageSupport;
hostOptions.coverageReportGenerator = this.coverageReportGenerator;
// trimTestConfiguration is a global analysis option and should be platform-agnostic
hostOptions.trimTestConfiguration = this.trimTestConfiguration;
hostOptions.experimentalRetainTestConfigurationAcrossTestonly =
this.experimentalRetainTestConfigurationAcrossTestonly;
return hostOptions;
// Options here are either:
// 1. Applicable only for the test actions, which are relevant only for the top-level targets
// before host or exec transitions can apply.
// 2. Supposed to be build-universal and thus non-transitionable anyways
// (e.g. trim_test_configuration)
// And thus the options should just be copied and not reset by the exec transition (as
// resetting them has incremental performance drawbacks when these options change).
return clone();
}
}

Expand Down

0 comments on commit 2adf003

Please sign in to comment.