summaryrefslogtreecommitdiff
path: root/ci/build_test_suites_test.py
AgeCommit message (Collapse)Author
2025-03-12Keep track of which test infos use which target Luca Farsi
Modify build script to keep track of which test info uses which target, which will be necessary for intra-zip test discovery later Test: test Bug: 358215235 Change-Id: I3d51d6527396fc1538d51602ad84084dbcdc7b0e
2024-12-11Add robustness to possible empty BUILD_CONTEXT Julien Desprez
We find possible evidence that BUILD_CONTEXT existed but was incorrectly empty. Adding robustness for this for safety while continuing to investigate the root cause. Change-Id: I8e9149a97e8cba8291cb41e010d75102a437ad87 Test: presubmit Bug: 383383586
2024-12-07Enable real test discovery in build_test_suites Luca Farsi
Enable test discovery to actually affect build targets in build_test_suites.py (only when the flags are enabled. On failure of test discovery or if the flags are off instead fall back to the previous optimizations. Change-Id: I6937dd0c5096884095d0770bc53b6399233cefc2 Test: atest build_test_suites_test Bug: 378926009
2024-12-06Add --device-build flag to build_test_suites.py Luca Farsi
The flag will be used to differentiate device builds so we can do the appropriate BWYN logic. Also include DIST_DIR as a required env var. Bug: 378704055 Change-Id: I203645ab82d52024a713c41c6fdc806f8672f7cc Test: atest build_test_suites_test
2024-11-14Begin reporting Test Discovery Agent metrics Luca Farsi
Start running the Test Discovery Agent and reportings its results via metrics. No changes to the actual build process yet. Test: atest build_test_suites_test && atest optimized_targets_test Bug: 372973116 Change-Id: I958e034985c41ede8d6a2700311a4dd6e7ac18ba
2024-11-14Record initial metrics in build_test_suites Luca Farsi
Record initial metrics for analysis time and packaging time in build_test_suites. Per-target metrics will be reported after initial test discovery agent integration. Test: atest build_test_suites_test && atest optimized_targets_test Bug: 372973116 Change-Id: Id3711ce078bfbfdc4c264a29751c475b4bd0cebd
2024-09-19Fix packaging outputs commands Luca Farsi
There were a few issues with the output packaging process that were found during testing of the general-tests optimization. First and foremost is that the packaging commands were trying to be created before the build ran, when the outputs don't exist. I've changed the logic to just collect the methods themselves which will then be run during build plan execution after the build has completed. A few other smaller issues include fixing the path to the soong_zip binary, incorrect execution of the soong dumpvars command, and not building the shared libs zip. Test: atest build_test_suites_test; atest optimized_targets_test Bug: 358215235 Change-Id: I8a3f54738f8bb5d871aadf7423844076c38b54a6
2024-09-10Refactor package_outputs Luca Farsi
Refactor package_outputs in the TestOptimizer so it just returns a list of soong_zip commands to be run by build_test_suites. Since we already have a tested implementation for running subprocesses in build_test_suites.py there's no reason to reimplement it in optimized_targets.py. Because any packaging will ultimately use soong_zip to package its final outputs change the code to just do whatever prep it needs to and return a list of soong_zip commands. This way the code is simpler to test without requiring subprocesses and no reimplementation of subprocess running code is necessary. Test: atest build_test_suites_test; atest optimized_targets_test Bug: 358215235 Change-Id: I3025aefeeb7186f537266a72d8422211ca9835ba
2024-08-26add BuildContext class and fix enabled features Luca Farsi
Add a BuildContext class to simplify parsing the build context dict, and fix the parsing of enabledBuildFeatures, which was being parsed as a list of strings when it's actually a list of dicts like: [{'name': '<feature_name>'}] Test: atest build_test_suites_test Bug: 361605425 Change-Id: I6424c444daf1582e92313c39f43207cb274aa78f
2024-08-12Change artifact matching to be more strict Luca Farsi
The current artifact matching logic will cause any test target that uses something like .*-tests.zip to be way too broad in what it causes to build. Change the logic to look for the target name in the artifact matching regex to make it so that only tests that look for a specific target to match. Test: atest build_test_suites_test Bug: 348489774 Change-Id: Ia75e38b676607f45f2b1c8fcf948045c248f1729
2024-08-08Refactor OptimizedBuildTarget and add general-tests optimization Luca Farsi
Refactor the OptimizedBuildTarget base class to more simply handle enabling/disabling build optimizations based on flags. Now all optimizers (aside from the no-op NullOptimizer will have their enabling built into the base class, and also necessitate their get_build_targets and package_outputs functions to be defined in order to not error out. Add the GeneralTestsOptimizer class as well, unimplemented for now. Test: atest build_test_suites_test Bug: 358215235 Change-Id: Ide22c64fc238d754db8d8e76484947401e54e680
2024-08-02Don't build targets if they're not used. Luca Farsi
Add functionality in build_test_suites.py to not build targets if their outputs are not used in the test configurations saved in the build context. If none of the tests reference the targets' outputs they will not be built at all. Note that the corresponding flags will need to be enabled for these optimizations to take place. Test: atest optimized_targets_test Bug: 348489774 Change-Id: I8f0ac90e75552ae80073f13229b026c7f23476a6
2024-06-07Add optimized build features in build_test_suites Luca Farsi
Add the optimized build feature in build_test_suites. WIP Test: WIP Bug: 342264003 Change-Id: I05a4ac4026c345f7ced771aa6deb1b6d1c38705c
2024-04-18Stream build process output Luca Farsi
Ensure that output and errors from the underlying build command are streamed for real-time build progress updates and debugging. This change strips out all code that is currently unecessary and adds tests for the remaining functionality. Test: atest --host build_test_suites_local_test build_test_suites_test Bug: 330365727 Change-Id: I7ef98d6654fe1435cf67c15e2c516a0967e03a75