Commit Graph

6 Commits

Author SHA1 Message Date
Luca Farsi
b130e791b6 add BuildContext class and fix enabled features
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-26 12:26:48 -07:00
Luca Farsi
99d40d7554 Change artifact matching to be more strict
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-12 09:59:11 -07:00
Luca Farsi
70a53bd6cf Refactor OptimizedBuildTarget and add general-tests optimization
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-08 12:02:57 -07:00
Luca Farsi
b24c1c3dbd Don't build targets if they're not used.
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-08-02 14:45:36 -07:00
Luca Farsi
040fabea76 Add optimized build features in build_test_suites
Add the optimized build feature in build_test_suites. WIP

Test: WIP
Bug: 342264003
Change-Id: I05a4ac4026c345f7ced771aa6deb1b6d1c38705c
2024-06-07 15:01:18 -07:00
Luca Farsi
db136447a6 Stream build process output
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
2024-04-18 19:02:50 +00:00