Also, removes the workaround that allowed preparers to override files
added in javaMockFS().
The performance of the java tests was determined by running:
m nothing
rm -fr out/soong/.bootstrap/soong-java/test/
time m nothing
Prior to starting this work that returned:
real 1m30.060s
user 33m3.028s
sys 13m25.413s
Immediately prior to this change that returned:
real 1m2.777s
user 14m14.352s
sys 9m40.745s
After applying this change that returned:
real 0m20.282s
user 3m7.429s
sys 0m43.601s
So, this reduced the real time cost of running the java tests from 90
seconds to 20 seconds.
Bug: 182638834
Test: m nothing
Change-Id: I30490fd40ddb0684a5a4975ce1811bab5dc79e4e
The main complication with this change was that many of the tests check
paths that are provided by the default java modules. The location of
them is different in the test fixtures that it is when using
testConfig() and so the test needed to be changed.
Bug: 182638834
Test: m nothing
Change-Id: I6d325dbd3ba39e5de7e53c576d7cfe07bd95a965
This excludes the bp2build mutator from running for cc_genrule or
java_genrule, which may require alternative implementations.
Test: bp2build; bazel build //bionic/...
Change-Id: Ie14dd6dfa5e806fd6ac6e8f9989356f3880c79bf
The test running code would only check errors if there were any
reported. That ignored the "module with duplicate runfile path" test
which was not reporting the expected error.
This change corrects that mistake, and then fixes the test which had
started to fail.
It is possible that the failing test highlights a bug in the python
code but if so that will need to be fixed in a follow up bug.
Bug: 183046274
Test: m nothing
Change-Id: I961b15a452725e7b15ba9d21b4a4a672ba3d004a
This variable tells reproxy the number of times an action that
mismatches between local and remote-executions should be run remotely to
determine if the action is inherently non-deterministic.
An action is considered non-deterministic if the number of unique output
digests we get from the remote-run is > 1.
Bug: b/178842439
Change-Id: I0d50eed29b801be67a7ede9b25ce7f4535980f05
It just provides the metadata needed by the global singleton as the
rest is in the apex.
Bug: 182402754
Test: m nothing
Change-Id: I511df7a3a06dab13ddb9ad63392ae5310dfee9c4
An upcoming change to create a prebuilt_platform_compat_config module
will break if the apex tries to use it instead of a
platform_compat_config because the former does not provide all the
information that the apex needs. This change will allow the
compatConfigsTag to be configured to prevent the prebuilt from being
used even when it is preferred.
Bug: 182402754
Test: m nothing
Change-Id: Ib9dc06c038f7cf3fc229f3c4d2b025335a4715b4
The platform_compat_config_singleton only needs access to the metadata
so this separates that method into its own interface, distinct from the
one needed by the apex. This also adds a test to ensure that the merging
still works.
Bug: 182402754
Test: m nothing
Change-Id: I5212239786810e5fc5eb99831b1122db93d1329f
The types and methods are separated and interleaved with each other
so this moves them so that they are together.
Bug: 182402754
Test: m nothing
Change-Id: I275f6af30491d2440499b9ee3f201eea227d23f8
Replaces the uses of buildDir in the unit test methods with t.TempDir()
as it just needs a temporary directory.
Bug: 182885307
Test: m nothing
Change-Id: I70452d548eff53c0bccada09f60eba7a615b5371
Sometimes it is necessary to optionally add a preparer. e.g. There are
many parameterized tests where one of the parameters is some additional
test setup but not every test provides it so it will default to the
"zero" value of whatever type is used for the test setup parameter
Migrating those tests to use test fixtures will typically require that
the test setup parameter be changed to a FixturePreparer, which by
default will be nil.
Attempting to use a nil FixturePreparer in the test fixtures will fail
so the OptionalFixturePreparer was added to wrap a possibly nil
FixturePreparer and thereby avoiding complicating each test with
similar logic.
Bug: 182885307
Test: m nothing
Change-Id: Ia12b2af2105fdc69af4e0b909a37a7b86f1af299
This test does not process any bp files it just needs a directory to
pass to TestConfig so it can use that to fake a PathContext. So, this
just replaces buildDir with a call to T.TempDir().
Bug: 182885307
Test: m nothing
Change-Id: I17c0435b7c45e4f8cb8b03a8ec8e57cfe397975b