Commit Graph

34546 Commits

Author SHA1 Message Date
Treehugger Robot 9b6108f8de Merge "Fix PackagingBase.CopyDepsToZip" 2021-03-23 04:21:38 +00:00
Treehugger Robot 04a2693407 Merge "Fix default value of BoardSepolicyVers" 2021-03-23 03:53:18 +00:00
Paul Duffin 4a1d451405 Convert boot_image_sdk_test.go to fixtures
Bug: 182638834
Test: m nothing
Change-Id: I8c9cb399b15d04ec8465a3b3bb4b43561aef46fd
2021-03-22 19:13:22 +00:00
Paul Duffin cf3ee2f87e Allow sdk package tests to optimize their test setup
Extracts the setup for apex from prepareForSdkTest to allow it to be
reused without using all of it. That will allow tests to optimize their
test setup.

Bug: 182638834
Test: m nothing
Change-Id: I2056103b15c2737a616ee29ff890c6af0722e6d2
2021-03-22 18:31:53 +00:00
Paul Duffin c93c98e315 Use test fixtures in CheckSnapshot()
Using the preparer(s) that were used to run the test to verify the
integrity of the generated snapshot ensures that it will be verified in
the same environment as the snapshot was generated. This ensures that
as sdk tests are migrated to use fixtures that are optimized for each
test that they will benefit from those optimizations when checking the
snapshot.

Bug: 183184375
Test: m nothing
Change-Id: I62b383f9a1d9a77d1cabb101d9d1e4a976170fe3
2021-03-22 18:31:53 +00:00
Paul Duffin 70d3bee3e0 Remove emptyFixtureFactory from apex and java
Bug: 183235980
Test: m nothing
Change-Id: I350b45e2f57430fb158f4141a566e75de17208cd
2021-03-22 18:31:53 +00:00
Paul Duffin 89648f98fa Remove usages of FixtureFactory from misc packages
These packages have already been migrated to use per test build
directory so have no need for a FixtureFactory.

Bug: 183235980
Test: m nothing
Change-Id: I667d1d992caaf0f615de91f89efdae11c44986c2
2021-03-22 18:31:53 +00:00
Paul Duffin 30ac3e7ca7 Remove uses of FixtureFactory from android package
Bug: 183235980
Test: m nothing
Change-Id: I72898ada020ee1a73fd534c61afb5c22fa00c1e5
2021-03-22 18:31:53 +00:00
Paul Duffin ff2aa69a86 Deprecate FixtureFactory in favor of FixturePreparer
Prior to this FixtureFactory was basically a FixturePreparer with the
additional support for buildDirSupplier. This makes that a reality by
moving the functionality of FixtureFactory into FixturePreparer and
making FixtureFactory extend that with buildDirSupplier.

This also deprecates the Extend() method in favour of simply using the
GroupFixturePreparers() method.

Once all usages of buildDir have been removed so the buildDirSupplier
is no longer required then FixtureFactory will be removed altogether.
In the meantime follow up changes will migrate those tests that do not
require a buildDirSupplier to just use FixturePreparers in preparation
for the eventual removal of FixtureFactory.

Bug: 183235980
Test: m nothing
Change-Id: Ibb4e5bfec2f76ee34dd7de6aed6bbbfe27d337b8
2021-03-22 18:31:53 +00:00
Paul Duffin 4ca6752b21 Replace FixturePreparer.visit() with list()
The visit() method was dropped in favor of a list() method as the
latter makes it easier to treat fixtureFactory, simpleFixturePreparer
and compositeFixturePreparer as simple collections of already flattened
and deduped *simpleFixturePreparers. That will be used in a follow up
change.

Bug: 183235980
Test: m nothing
Change-Id: Ia41ae9bd4f9c39c85865ba698e0da6be00519caf
2021-03-22 18:31:53 +00:00
Paul Duffin cff464f794 Remove errorHandler from FixtureFactory
The ExtendWithErrorHandler method simply wraps the FixtureErrorHandler
in a FixturePreparer that will set the error handler in the fixture.

Bug: 183235980
Test: m nothing

Change-Id: Icf9a5f62cb532efc120300c2f906cd3397aa6763
2021-03-22 18:31:53 +00:00
Paul Duffin 592518290f Allow access to preparers that produced a TestResult
The Preparer() method allows for another test to be run using the same
preparers as were used to create the TestResult. That is useful when
testing functionality like the sdk snapshot mechanism that generates an
Android.bp and a set of files that are intended to be reconsumed by
Soong. This method allows the test to process that output to ensure
that it is valid. A follow up change will migrate the CheckSnapshot()
method to use this as part of the migration of the sdk package to the
test fixture model.

Previously, the dedupAndFlattenPreparers() would not construct a list
containing all the preparers passed to it as it was trying to avoid
constructing such a list unless necessary. However, as every usage of
this method now needs to construct such a list that functionality has
been added to it.

Bug: 181070625
Test: m nothing
Change-Id: Iab34e2c861bdfd05c44e982224f70c5abc19e468
2021-03-22 18:31:53 +00:00
Paul Duffin 6bef6fee3c Merge "Ensure that DepIsInSameApex is not called for ExcludeFromApexContentsTag" 2021-03-22 18:30:10 +00:00
Pirama Arumuga Nainar 679d5308ec Merge "Switch to clang r416183 12.0.4." 2021-03-22 16:26:13 +00:00
Inseob Kim 0c4eec85fa Fix default value of BoardSepolicyVers
PlatformSepolicyVersion and BoardSepolicyVers haven't assigned correctly
so far. Below is the reason why it hasn't been discovered yet.

DeviceConfig.PlatformSepolicyVersion() was added to support mixed
sepolicy build (setting BOARD_SEPOLICY_VERS and building vendor sepolicy
with old plat policy files). Soong compares PlatformSepolicyVersion()
and BoardSepolicyVers(), and used old vendor sources if both are
different. Back then, the only place where such logic played a role was
selinux contexts. Test codes were running as intended: after setting
BOARD_SEPOLICY_VERS the context files were built against old policies.

But there were two mistakes:

1) PlatformSepolicyVersion() was not added to soong_config.mk, so it was
always empty.
2) BOARD_SEPOLICY_VERS was set to default in system/sepolicy/Android.mk,
which was processed after soong_config. So if BOARD_SEPOLICY_VERS was
not set in BoardConfig.mk, BoardSepolicyVers() was empty, not
PLATFORM_SEPOLICY_VERSION.

And there were no issues as Soong only checked equality.

To fix the issue correctly, this commit adds the variable
PlatformSepolicyVersion, and then handles BoardSepolicyVers correctly by
returning PlatformSepolicyVersion if it's empty.

Test: set BOARD_SEPOLICY_VERS and see vendor_file_contexts changes
Change-Id: Ie55827f47d2903e9739eccacc3874d354d5c9f2d
2021-03-22 22:34:56 +09:00
satayev 2b077baa5e Merge changes from topic "move_allowed_deps_txt"
* changes:
  Treat allowed_deps.txt source file as optional.
  Move allowed_deps.txt to packages/modules/common.
2021-03-22 10:48:45 +00:00
Paul Duffin 3d5f6a1034 Merge "Prevent invalid paths being added to mock file system" 2021-03-22 08:58:54 +00:00
Paul Duffin c737facd2b Merge "Replace AssertPanic with AssertPanicMessageContains" 2021-03-22 08:58:28 +00:00
Paul Duffin 4c3e8e2d67 Ensure that DepIsInSameApex is not called for ExcludeFromApexContentsTag
The ExcludeFromApexContentsTag marker interface was added to avoid
every implementation of DepIsInSameApex() from having to deal with the
special tags, like PrebuiltDepTag. Unfortunately, when adding that
not all calls to DepIsInSameApex() were protected which meant that the
BootImageModule, which panics if it doesn't recognize a tag, was
causing failures. This change documents the need and improves the
consistency.

A follow up change will add a test for this.

Bug: 182992071
Test: m nothing
Change-Id: If0bf9a7447ebf7a0bb0c88e91951a7220d4af45c
2021-03-22 08:43:55 +00:00
Paul Duffin 50e49818a3 Merge "Cleanup the now unused testCustomizer" 2021-03-22 08:06:40 +00:00
Paul Duffin b535616a84 Merge "Convert test specific customizers to FixturePreparers" 2021-03-22 08:06:26 +00:00
Paul Duffin 7ba0448314 Merge "Convert shared customizer functions to return FixturePreparers" 2021-03-22 08:05:56 +00:00
Paul Duffin 241f547365 Merge "Allow test handlers to be either FixturePreparer or testCustomizer" 2021-03-22 08:05:36 +00:00
Paul Duffin 043427b276 Merge "Convert apex/boot_image_test.go to use test fixtures" 2021-03-22 08:05:21 +00:00
Paul Duffin 32b0e07228 Merge "Switch testApex and related methods to use test fixtures" 2021-03-22 08:04:55 +00:00
Treehugger Robot 5e737ad1d5 Merge "Allow customization of all fixture state at once" 2021-03-21 23:48:43 +00:00
Paul Duffin 3bcdfe8bbb Merge "Add prepareForSdkTestWithJava" 2021-03-21 11:07:03 +00:00
Paul Duffin d5deba1126 Merge "Java build components require android build components" 2021-03-21 11:06:33 +00:00
Paul Duffin d14cbc1e69 Add prepareForSdkTestWithJava
Bug: 182638834
Test: m nothing
Change-Id: I86cb08a640c7e39c1eaaf54926699f32a32ccc9b
2021-03-21 11:01:13 +00:00
Paul Duffin ce5a4547bb Java build components require android build components
Java build components invariably require android build components such
as the arch mutator (to create the common variant) so include them
together.

Bug: 181070625
Test: m nothing
Change-Id: I435b09a34c48c67b890368b37b8da27e8de97c9a
2021-03-21 10:20:25 +00:00
Treehugger Robot f2be52c4dc Merge "Revert "[strip.sh] Move remaining GNU binutils usage to llvm binutils"" 2021-03-20 19:25:23 +00:00
Jaewoong Jung 2406d689bf Merge "Take Module implementations out of java/java.go." 2021-03-20 15:29:32 +00:00
David Srbecky 33dfba1d9c Revert "[strip.sh] Move remaining GNU binutils usage to llvm binutils"
This reverts commit ad50ce8349.

Bug: 183237575
Reason for revert: Breaks stack unwinding

Change-Id: I256dc77525687fb3e670355587b1eac72158b274
2021-03-20 14:46:15 +00:00
Treehugger Robot 8cc04e59e1 Merge "manifest_check.py: translate library names using dexpreopt configs." 2021-03-20 12:12:52 +00:00
Paul Duffin 80f4cea1ad Prevent invalid paths being added to mock file system
Bug: 182885307
Test: m nothing
Change-Id: Ie9f60fd02e2a2bc44811dbcadf0eada4e52c9749
2021-03-20 12:11:20 +00:00
Paul Duffin 9f4b3bbb7c Replace AssertPanic with AssertPanicMessageContains
Bug: 182885307
Test: m nothing
Change-Id: Idffa314285c90080796cc3df391de9c314eaa422
2021-03-20 12:08:51 +00:00
Paul Duffin 40b6257dc1 Cleanup the now unused testCustomizer
Bug: 181070625
Test: m nothing
Change-Id: I825e0da53b7fd82f4ef33d7183351c1f2ed8ee23
2021-03-20 11:42:48 +00:00
Paul Duffin 0a49fdca0b Convert test specific customizers to FixturePreparers
Bug: 181070625
Test: m nothing
Change-Id: I1c4b7303a1153b040b7266e95b06d172554dc52a
2021-03-20 11:39:23 +00:00
Paul Duffin 810f33d9ee Convert shared customizer functions to return FixturePreparers
Bug: 181070625
Test: m nothing
Change-Id: I8d09f91a3db23eb36cd73a13e418df98949ec72d
2021-03-20 11:33:03 +00:00
Paul Duffin 2be9dcd3aa Allow test handlers to be either FixturePreparer or testCustomizer
This allows the testCustomizers to be switched to FixturePreparers
incrementally rather than in one go.

Bug: 181070625
Test: m nothing
Change-Id: Idd9d2e28abf9b17fc46b5566ab8d3affa330287e
2021-03-20 10:25:45 +00:00
Paul Duffin 34d433ad7e Convert apex/boot_image_test.go to use test fixtures
Bug: 181070625
Test: m nothing
Change-Id: I940353e32233317d9e932b2d61908125e4c33766
2021-03-20 10:25:45 +00:00
Paul Duffin e05480ac47 Switch testApex and related methods to use test fixtures
Bug: 181070625
Test: m nothing
Change-Id: Icdd9c3d807d5497ef85946a877c6cd4b4af045bc
2021-03-20 10:25:45 +00:00
Paul Duffin ae542a58af Allow customization of all fixture state at once
Adds FixtureCustomPreparer.

Bug: 181070625
Test: m nothing
Change-Id: I310e16661a0f032f778481d9b69da2e0e9a084cf
2021-03-20 10:25:45 +00:00
Jaewoong Jung 263426431a Take Module implementations out of java/java.go.
Test: TreeHugger
Change-Id: I5c39915ad2cadf5981c201a2b412916524d4c3e2
2021-03-19 15:46:38 -07:00
Julien Desprez 0387862185 Merge "Migrate manifest_*_test out of test mapping" 2021-03-19 21:47:24 +00:00
Paul Duffin 479605bed7 Merge changes I6b868bac,If75f4718
* changes:
  Migrate android package to a per test build directory
  Convert android/path_properties_test.go to test fixtures
2021-03-19 17:28:38 +00:00
Colin Cross d2db7953a0 Merge changes Iab4e09d9,Icf2f24dd,I15be5ef1,Ic0db9619
* changes:
  Run lint actions in sbox
  Support sbox-in-RBE
  Move android package on top of remotexec
  Support sandboxing inputs in RuleBuilder
2021-03-19 17:25:14 +00:00
Julien Desprez 2dc86b2956 Migrate manifest_*_test out of test mapping
Unit tests do not require an explicit TEST_MAPPING config

Change-Id: Ieccebc78a26b9555803a2278e2962d0b388a6957
Test: presubmit
Bug: 183209529
2021-03-19 17:16:16 +00:00
Yi Kong 00d54280d0 Merge "[strip.sh] Move remaining GNU binutils usage to llvm binutils" 2021-03-19 15:32:49 +00:00
Paul Duffin 54a5e9a467 Merge "Remove javaMockFS()" 2021-03-19 14:18:46 +00:00