Revert submission 3060229-ron-tmc-symlinks
Reason for revert: Droidmonitor created revert due to b/344045516
Reverted changes: /q/submissionid:3060229-ron-tmc-symlinks
Change-Id: If5045366677163560cdae95c0ab74256b4b49b9a
Now the derived modules will have symlink's to base's testcase dir
rather than copyfile files from base's intermediates dir.
I also removed storing the "base" module as dependency and only use
data from the provider in GenerateAndroidBuildActions and
AndroidMkEntries.
I did have to add two fields to the provider for this.
To ensure the symlinks always resolve to a physical file, I also added
goals such that building `derived-target` will also build `build-target`
Create new Make variable: LOCAL_SOONG_INSTALLED_COMPATIBILITY_SUPPORT_FILES
for tasks/general-tests.mk,device-tests.mk to read.
This allows "support" files that are installed with soong rules rather
than make rules to still end up in the zips.
Sample dir structure:
% tree -ls testcases aosp_cf_x86_64_phone[4:31:54]/0
[ 4096] testcases
├── [ 4096] FrameworksServicesTests
│ ├── [ 4096] data
│ │ └── [ 851] broken_shortcut.xml
│ ├── [ 2800] FrameworksServicesTests.config
│ ├── [ 12695] JobTestApp.apk
│ ├── [ 8599] MediaButtonReceiverHolderTestHelperApp.apk
│ ├── [ 16791] SimpleServiceTestApp1.apk
│ ├── [ 16791] SimpleServiceTestApp2.apk
│ ├── [ 16791] SimpleServiceTestApp3.apk
│ ├── [ 1017763] SuspendTestApp.apk
│ └── [ 4096] x86_64
│ └── [ 79827767] FrameworksServicesTests.apk
└── [ 4096] FrameworksServicesTests_contentprotection
├── [ 4096] data
│ └── [ 54] broken_shortcut.xml -> ../../FrameworksServicesTests/data/broken_shortcut.xml
├── [ 3005] FrameworksServicesTests_contentprotection.config
├── [ 41] JobTestApp.apk -> ../FrameworksServicesTests/JobTestApp.apk
├── [ 69] MediaButtonReceiverHolderTestHelperApp.apk -> ../FrameworksServicesTests/MediaButtonReceiverHolderTestHelperApp.apk
├── [ 52] SimpleServiceTestApp1.apk -> ../FrameworksServicesTests/SimpleServiceTestApp1.apk
├── [ 52] SimpleServiceTestApp2.apk -> ../FrameworksServicesTests/SimpleServiceTestApp2.apk
├── [ 52] SimpleServiceTestApp3.apk -> ../FrameworksServicesTests/SimpleServiceTestApp3.apk
├── [ 45] SuspendTestApp.apk -> ../FrameworksServicesTests/SuspendTestApp.apk
├── [ 36] test_module_config.manifest
└── [ 4096] x86_64
├── [ 64] FrameworksServicesTests.apk -> ../../FrameworksServicesTests/x86_64/FrameworksServicesTests.apk
└── [ 36] UNUSED-FrameworksServicesTests.apk
Test: m clean && atest FrameworksServicesTests_contentprotection
Test: m clean && atest CtsDevicePolicyManagerTestCases_ParentProfileApiDisabled
Bug: b/332320956
Change-Id: I8466f253fa559bc74cef4533edf263650e96bbfb
This pairs with `test_module_config` but also works on the base is a
`java_test_host` module.
e.g.
test_module_config_host {
name: "CtsOsHostTestCases_DERIVED_2566",
base: "CtsOsHostTestCases",
test_suites: ["general-tests"],
include_filters: [ "android.os.cts.StaticSharedLibsHostTests" ],
exclude_annotations: [ "androidx.test.filters.FlakyTest","org.junit.Ignore" ],
}
The new module is composed of the previous and shares much of the same
code.
With respect to build size,
Without this change, if you build CtsAppSecurityHostTestCases, there
will be several copies of the jar (and related apks) :
*) 1 in framework
out/host/linux-x86/framework/CtsAppSecurityHostTestCases.jar
*) 1 in testcases for the test
out/host/linux-x86/testcases/CtsAppSecurityHostTestCases/CtsAppSecurityHostTestCases.jar
*) 1 per compatibility suite testcases
out/host/linux-x86/mts-documentsui/android-mts-documentsui/testcases/CtsAppSecurityHostTestCases/CtsAppSecurityHostTestCases.jar
out/host/linux-x86/mts-mediaprovider/android-mts-mediaprovider/testcases/CtsAppSecurityHostTestCases/CtsAppSecurityHostTestCases.jar
out/host/linux-x86/mts/android-mts/testcases/CtsAppSecurityHostTestCases/CtsAppSecurityHostTestCases.jar
out/host/linux-x86/cts/android-cts/testcases/CtsAppSecurityHostTestCases/CtsAppSecurityHostTestCases.jar
out/host/linux-x86/mts-mainline-infra/android-mts-mainline-infra/testcases/CtsAppSecurityHostTestCases/CtsAppSecurityHostTestCases.jar
A dervived test using CtsAppSecurityHostTestCases as base adds one more
to its testcases dir:
*) derived testcase.
out/host/linux-x86/testcases/CtsAppSecurityHostTestCases_presubmit_ExternalStorageApp/CtsAppSecurityHostTestCases.jar
Fixes: b/327280990
Test: m clean && m CtsOsHostTestCases_DERIVED_2566# as above
Test: atest CtsOsHostTestCases_DERIVED_2566 --collect-tests-only
Test: migrated the 71 TestMapping instances to Android.bp and build them.
Ran tests on some of them.
Ran some original `test_module_config` tests derived from `android_test` as well
TODO: Add actions to validate the given filters are valid for the given
test apks/jars.
Change-Id: I115eedb6ff6ba8e72bb49e71867daf49d25ca0f1
New soong module type `TestModuleConfig`
This module type allows to write:
test_module_config {
name: "DerivedFrameworks1",
base: "FrameworksServicesTests",
include_filters: ["com.android.server.accessibility.FingerprintGestureDispatcherTest"],
}
This goal is to put the test options (include_fitler in this case) in
Android.bp rather than TEST_MAPPING to be able to name a set of options
and to allow the CI to more precise about which part of a TestModule
might be failing.
In general, it is recommended to split up tests rather than use this
approach, but that isn't always feasible.
More details on project here: https://docs.google.com/document/d/1MpA4BS6mTr-1D-K9MVmzdHkSufAvIkkM4gPEUglNodk/edit?tab=t.0
Migration plan here: https://docs.google.com/document/d/1x3w-BvKO3E-GbY8YOSBuzJC6-pkLkuhfjSyZ1hJQBYM/edit?tab=t.0
Some details of final output:
* All the [data] files from Derived are the same as base.
* The apk names is changed to be the Module name
* The test options are added to .config file
* test-file-name in the .config file (for base.apk) is changed to be
new apk.
* module-info.json is hand inspected between base and derived.
* I added a .manifest file so future tools know what base is, if they
need it.
We are working a mechanism to use a CAS so the zip of the testcases
won't explode. (however the trident disk image will get bigger)
% tree -ls out/target/product/shiba/testcases/DerivedFrameworks1 out/target/product/shiba/testcases/FrameworksServicesTests
[ 4096] out/target/product/shiba/testcases/DerivedFrameworks1
├── [ 4096] arm64
│ └── [ 72346281] DerivedFrameworks1.apk
├── [ 20887] BstatsTestApp.apk
├── [ 4096] data
│ └── [ 851] broken_shortcut.xml
├── [ 3157] DerivedFrameworks1.config
├── [ 12695] JobTestApp.apk
├── [ 8599] MediaButtonReceiverHolderTestHelperApp.apk
├── [ 16791] SimpleServiceTestApp1.apk
├── [ 16791] SimpleServiceTestApp2.apk
├── [ 16791] SimpleServiceTestApp3.apk
├── [ 1017540] SuspendTestApp.apk
└── [ 36] test_module_config.manifest
[ 4096] out/target/product/shiba/testcases/FrameworksServicesTests
├── [ 4096] arm64
│ └── [ 72346281] FrameworksServicesTests.apk
├── [ 20887] BstatsTestApp.apk
├── [ 4096] data
│ └── [ 851] broken_shortcut.xml
├── [ 2866] FrameworksServicesTests.config
├── [ 12695] JobTestApp.apk
├── [ 8599] MediaButtonReceiverHolderTestHelperApp.apk
├── [ 16791] SimpleServiceTestApp1.apk
├── [ 16791] SimpleServiceTestApp2.apk
├── [ 16791] SimpleServiceTestApp3.apk
└── [ 1017540] SuspendTestApp.apk
Fixes: 314148134
Test: atest DerivedFrameworks1 DerivedFrameworks2
Test: m blueprint_tests
Change-Id: Ib73a3404557e0bd583b065f0cf2fd55fba9ccdbe
The original `tradefed_binary_host` in Soong always used the host OS
architecture when writing the `arch` in `test-suite-info.properties`.
This change introduces the `Suite_arch` attribute in
`tradefed_binary_host`, allowing users to specify the architecture
for `test-suite-info.properties`.
Bug: 313535357
Test: 1. Add property of `suite_arch` in the Android.bp
2. m cts-tradefed
3. check `test-suite-info.properties` in cts-tradefed.jar
Change-Id: Ib95db4e0e8d238c9bb8a2a3fffea606fa6a764ce
Remove the ConvertWithBp2build implementations from all the module
types, along with the related code.
Bug: 315353489
Test: m blueprint_tests
Change-Id: I212672286686a318893bc7348ddd5a5ec51e77a7
This no-op refactoring facilitates some upcoming functional changes for
"bp2build allowlist v2". The work requires that the bp2build conversion
mutator be changed from a TopDown mutator to a BottomUp mutator.
Refactoring all bp2build-related methods so that they use Bp2buildMutatorContext
makes it easier to make this functional change without touching tens of
files and multiple projects.
Bug: 285631638
Test: m bp2build
Change-Id: I3d1ef3064146e959c6f0dc315350fc9764bf2bd2
Mobly is a Python-based test framework that specializes in supporting
test cases that require multiple devices. There are some Mobly based
Android tests, but these tests cannot be added to xTS since they are
not using TF. Currently TF provides a 2-device Mobly test runner.
This change is a short-term solution to help teams (eg. bluetooth) to
add their multi-device Mobly tests to xTS without writing TF configs.
For long-term, device infra team and xTS infra team will provide a
solution for more complex multi-device tests in xTS and deprecate this
TF template.
Test: manually check the generated mobly xml config
Bug: 272239365
Change-Id: I252cc774094eebbd9264243d30023ace4839c2cd
The test name defaulting to ctx.ModuleName() was
accidentally removed, readd it
Bug: 184895128
Fixes: 264423240
Fixes: 264433459
Test: Verified ninja files produced with this cl and aosp/2372150 are the same as with aosp/2372150 reverted
Change-Id: I23ab8ab39132b93719cc6f797d92b1cabce5eae9
Some tests need to add custom tradefed options, but still want to
keep most of the soong autogenerated tradefed xml file.
Expose a test_options: { tradefed_options: [...] } property that
will allow tests to add more options to the autogenerated xml file.
Fixes: 184895128
Test: go test, and verified that the ninja files did not change for aosp_arm64
Change-Id: I50d4ad139322e9e207202f1e1a50f5bbb424aa6f
This reverts commit 8ec823cba1.
Reason for revert: DroidMonitor: Potential culprit for Bug b/262965953 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Change-Id: I236cc36981d8b30527ca286632727f8ca267e969
The BUILD file will now have the needed attributes to run the tradefed
test rules.
Test: b test //packages/modules/adb:adbd_test --platforms=//build/bazel/platforms:android_target
Change-Id: I5cb84ccdde27a7fadbef479269df594344a29187
Some tests need to add custom tradefed options, but still want to
keep most of the soong autogenerated tradefed xml file.
Expose a test_options: { tradefed_options: [...] } property that
will allow tests to add more options to the autogenerated xml file.
Fixes: 184895128
Test: go test, and verified that the ninja files did not change for aosp_arm64
Change-Id: I75f7eb002c8325ce7cdc76e12e76e16195320620
This commit adds support for a java_host_test that requires a target
binary to run. If the binary has host and target variants and is added
as a dependency in the `data` attribute, then the host variant is used.
Instead, we need a way to force the use of the target variant.
Bug: 182919153
Test: add code from aosp/1647282/1 && atest AuthFsHostTest
Change-Id: I68a6259b41a5e6809e1b82eec3122ffdf5067f56
Adds the require_root property to rust_test modules so that tests can
run as root. Also adds an install base to allow vendor tests to install
to a different path, otherwise installs to 'unrestricted' like cc_test.
Bug: 200602232
Test: test with require_root: true runs as root
Test: test installed to new base directory
Change-Id: Ifa716871ff87471f0c0caff7af558d47db85ccd1
Automatically generate required tradefed configs for rust benchmarks so
that they're available in atest.
Test: atest <module with rust_benchmark defined>
Bug: 155309706
Change-Id: I6002100367a66b6b0555614acc6cebb00dbf435d
Having two packages in the same directory makes it harder for go tools
to understande the directory structure.
For example, in build/soong, "go test ./cc/..." fails with cyclic
package imports.
Bug: n/a
Test: go test ./cc/... (in build/soong)
Change-Id: I7a040bf30b1e001680dd43fed9747e9651372274
Set the TEST_ROOT to /data/local/tmp/tests/vendor if LOCAL_VENDOR_MODULE or
LOCAL_USE_VNDK be set, if not, set to /data/local/tmp.
Bug: 138450837
Test: atest binderVendorDoubleLoadTest
Change-Id: I04acf12976dd24b9bf880a6775fa4f043a221001
Package a slightly modified copy of the robolectric tests with
the dependencies statically included into the testcases directory
and into a robolectric-tests.zip.
Test: m robolectric-tests
Change-Id: I73f51727695136d2a849d36af1683e93f7e156a3
c5b8749853 broke specifying a name via the
`autogenTemplateWithName` function by hard-coding
`ctx.ModuleName()`. This restores that functionality.
Bug: 158784626
Test: atest rustBinderTest_integration
Change-Id: I05674e85defb363aa3cdf3e2dd895d1174e6b48f
This changes the way the output filename is calculated for rust_test
binaries to be more similar to cc_test.
This also removes the option to define multiple test binaries in a
single rust_test module via the TestPerSrc mutator. Now each rust_test
module corresponds to a single test binary.
Bug: 158500462
Test: m -j pin-utils_tests_pin_utils
Test: m -j unicode-xid_device_tests_unicode_xid
Change-Id: I6e0f79dcb4e49fa49d6ebb36abeef67a9eb180a0
Supports the following properties:
- Require_root
- Test_config_template
- Auto_gen_config
Test config template is in a separate CL.
Bug: 148805488
Bug: 151761373
Test: make
Test: unit tests
Test: verified with bc_test & toybox-tests
Change-Id: I63d60a153a6abda4ce30b74d3eb915fbf6389cb8
Give prebuilt_etc and sh_binary their own packages and split the
gigantic main Android.bp up to small, per-package ones.
Test: m nothing, TreeHugger
Bug: 156980228
Change-Id: I7b00cd344b9f16861f1ff39edf0029f016b853d0
To support parameterized mainline modules in Test Mapping, we plan to
add a new parameter called test_mainline_modules in build system to
auto-generate the test config based on the parameter.
For detailed information: go/test-mapping-mainline-gcl
(search for auto-generated pattern)
Bug: 155238134
Test: add "test_mainline_modules: [some.apk]" to TetheringTests,
and build the modules, confirm the parameterized option is added
in the test config.
Change-Id: I41ba8749ce46da62db402a8b8a555d4874e1cfc0
To support parameterized mainline modules in Test Mapping, we plan to
add a new parameter called test_mainline_modules in build system to
auto-generate the test config based on the parameter.
For detailed information: go/test-mapping-mainline-gcl
(serach for auto-generated pattern)
Bug: 155238134
Test: add "test_mainline_modules: [some.apk]" to libstatspull_test,
and build the modules, confirm the parameterized option is added
in the test config.
Change-Id: I31d6dfbb71881d7a7026cf2f36ba6ca6a97870ad
Currently, soong will not autogenerate AndroidTest.xml files for
CTS tests. The comment says that this is because they can be used
for test data (in which case, autogenerating an AndroidTest.xml
file would not be correct).
Allow autogeneration of test files in the case that the buid rule
explicitly requests it using a test_config_template. This allows
CTS tests to use test_config_template.
Also remove a TODO that was already addressed by aosp/903934.
Test: patching aosp/1235232 and running "m CtsNetTestCases" results in test config
Change-Id: Ic3450b67c47745af5932edd82452fdf16d937ea7
* The RustBinaryTest runner and device test config template
are derived from GTest. Device tests are pushed to /data/local/tmp.
Bug: 140938178
Test: make unicode-xid projects; run atest
Change-Id: Idb4cab7872b48c6e25bc59b85aa6d9dece4383ec
* Rename testBinaryDecorator to testDecorator
* Add TestProperties
* Add install function for testDecorator to install config files
* Add tradefed.AutoGenRustHostTestConfig
* Depend on new build/make/core/rust_host_test_config_template.xml
and new tradefed.testtype.rust.RustBinaryHostTest class
* Add autogenTemplateWithName in tradefed/autogen.go
to generate config files with customized(mutated) executable name.
* Make rust_test module names more robust and easy to use.
* Use crate name instead of source file name as the Stem
for single source file modules, to match original user
specified output file name in Cargo.toml.
* Do not set up test module SubName when Stem is empty
or when the module name already contains Stem suffix.
That happens when TestPerSrcMutator is disabled or when
there is only one source file with renamed output file name.
* In TEST_MAPPING, references to mutated rust_test modules should be
(1) <module_name> for single source file modules without mutation, or
(2) <module_name>_<crate_name> for single source file modules, or
(3) <module_name>_<source_file_base_name> for multi-file modules.
Bug: 140938178
Test: mm in rust projects, check output test file names
Change-Id: Ifdbfa14d5eed4f10b4fb983f82c93bbb9be3f899
Attribute `auto_gen_config` is added to test modules.
Test config will be generated if:
the attribute is not set and AndroidTest.xml doesn't exists
or
the attribute is set to true, whether or not AndroidTest.xml exists.
Test config will NOT be auto-generated if:
the attribute is not set and AndroidTest.xml exists
or
the attribute is set to false, whether or not AndroidTest.xml exists.
Bug: 141684102
Test: build test module with auto_gen_config set to true
Change-Id: I64fb003a83d8c32a967835e5f8d12fe4476043be
The new option will allow the auto-generated test config for cc_test to
include MinApiLevelModuleController and check the api-level before test.
Bug: 140912549
Test: 1. $vi platform_testing/tests/example/native/Android.bp
2. add
test_min_api_level: 29,
or
test_min_sdk_version: 29,
3. $m -j hello_world_test
4. check hello_world_test.config
Change-Id: Ic742d41898928df1637890bec87796d90e886516
The new option will allow the auto-generated test config for cc_test to
include RunCommandTargetPreparer to disable framework before the test
run and re-enable it after the test run.
Bug: 140065309
Test: test hello_world_test with the new option.
Change-Id: If2189e9474f5b11bd0d0471e231a2cae14155389
require_root is added to allow auto-generated test config to include
RootTargetPreparer so the test runs with root permission.
Bug: 134509111
Test: add "require_root: true" to init_benchmarks and libpower_test
build the modules, confirm the extra target preparer is added in the
test configs.
Change-Id: Ia07503e338935d6aa92560e7cf7b18d2a4c51243
Follow the change to blueprint to make *Escape take and return a string
and add *EscapeList that take and return slices of strings. Fix up
a few places that were unnecessarily converting a string to a slice
and back to a string.
Test: m nothing
Change-Id: I3fa87de175522205f36544ef76aa2f04aef1b936
If an Android.bp specifies Isolated=true, make sure
it's tagged as not-shardable, since b/126376458 is not
resolved.
Test: make bionic-benchmarks-tests (with and without isolated=true)
Bug: 124024827
Change-Id: I2210c15b84f9b30e1cc23b426d463b34cf9ef94f
Current soong use source code's under cts as the rule for judgement.
Should change to use test_suites define instead.
Bug: 124313692
Test: m hello_world_test, make sure test config be auog-enerated.
Modified platform_testing/tests/example/native/Android.bp
m hello_world_test, make sure test config not be auto-generatetd.
Change-Id: I1bc5216f73329d2a82d9ff29ccbede436dd2976c