summaryrefslogtreecommitdiff
path: root/ci/build_test_suites_test.py
diff options
context:
space:
mode:
author Luca Farsi <lucafarsi@google.com> 2024-09-17 15:48:11 -0700
committer Luca Farsi <lucafarsi@google.com> 2024-09-19 11:01:06 -0700
commit8ea6742d053bb674c67a4b5c35e621a76462aa72 (patch)
tree236ef67bbe8a53eefa8eeb5d5308c54ceb032796 /ci/build_test_suites_test.py
parent75501177a56a3a3342a58cf573961f6d83b27cf9 (diff)
Fix packaging outputs commands
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
Diffstat (limited to 'ci/build_test_suites_test.py')
-rw-r--r--ci/build_test_suites_test.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/ci/build_test_suites_test.py b/ci/build_test_suites_test.py
index fd06a3ae1e..2afaab7711 100644
--- a/ci/build_test_suites_test.py
+++ b/ci/build_test_suites_test.py
@@ -276,7 +276,8 @@ class BuildPlannerTest(unittest.TestCase):
build_plan = build_planner.create_build_plan()
- self.assertEqual(len(build_plan.packaging_commands), 0)
+ for packaging_command in self.run_packaging_commands(build_plan):
+ self.assertEqual(len(packaging_command), 0)
def test_build_optimization_on_optimizes_target(self):
build_targets = {'target_1', 'target_2'}
@@ -306,7 +307,7 @@ class BuildPlannerTest(unittest.TestCase):
build_plan = build_planner.create_build_plan()
- self.assertIn([f'packaging {optimized_target_name}'], build_plan.packaging_commands)
+ self.assertIn(packaging_commands, self.run_packaging_commands(build_plan))
def test_individual_build_optimization_off_doesnt_optimize(self):
build_targets = {'target_1', 'target_2'}
@@ -328,7 +329,8 @@ class BuildPlannerTest(unittest.TestCase):
build_plan = build_planner.create_build_plan()
- self.assertFalse(build_plan.packaging_commands)
+ for packaging_command in self.run_packaging_commands(build_plan):
+ self.assertEqual(len(packaging_command), 0)
def test_target_output_used_target_built(self):
build_target = 'test_target'
@@ -485,6 +487,12 @@ class BuildPlannerTest(unittest.TestCase):
],
}
+ def run_packaging_commands(self, build_plan: build_test_suites.BuildPlan):
+ return [
+ packaging_command_getter()
+ for packaging_command_getter in build_plan.packaging_commands_getters
+ ]
+
def wait_until(
condition_function: Callable[[], bool],