41
41
@click .option (
42
42
'--build-only/--no-build-only' ,
43
43
default = False ,
44
- help = 'Whether to build tracing test apps only or to also submit to FTL afterwards'
44
+ help = 'Whether to only build tracing test apps or to also run them on FTL afterwards'
45
45
)
46
46
@ci_command ()
47
47
def macrobenchmark (build_only ):
@@ -62,12 +62,18 @@ async def _launch_macrobenchmark_test(build_only):
62
62
_logger .info (f'Processed yaml configurations: { config } ' )
63
63
64
64
tests = [MacrobenchmarkTest (app , artifact_versions , os .getcwd (), test_dir ) for app in config ['test-apps' ]]
65
- _logger .info (f'Building { len (tests )} macrobenchmark tests...' )
66
65
67
- if build_only :
68
- await asyncio .gather (* [x .run_build_only () for x in tests ])
69
- else :
70
- results = await asyncio .gather (* [x .run () for x in tests ], return_exceptions = True )
66
+ _logger .info (f'Building { len (tests )} macrobenchmark test apps...' )
67
+ # TODO(yifany): investigate why it runs significantly slower
68
+ # - on corp workstations than M1 macbook pro
69
+ # - with gradle 7.5.1 than gradle 6.9.2
70
+ # await asyncio.gather(*[x.build() for x in tests])
71
+ for test in tests :
72
+ await test .build ()
73
+
74
+ if not build_only :
75
+ _logger .info (f'Submitting { len (tests )} tests to Firebase Test Lab...' )
76
+ results = await asyncio .gather (* [x .test () for x in tests ], return_exceptions = True )
71
77
await _post_processing (results )
72
78
73
79
_logger .info ('Macrobenchmark test finished.' )
@@ -152,18 +158,16 @@ def __init__(
152
158
self .test_results_dir = str (uuid .uuid4 ())
153
159
self .gcs_client = storage .Client ()
154
160
155
- async def run (self ):
156
- """Starts the workflow of src creation, apks assembly, FTL testing and results upload ."""
161
+ async def build (self ):
162
+ """Creates test app project and assembles app and test apks ."""
157
163
await self ._create_benchmark_projects ()
158
164
await self ._assemble_benchmark_apks ()
165
+
166
+ async def test (self ):
167
+ """Runs benchmark tests on FTL and fetches FTL results from GCS."""
159
168
await self ._execute_benchmark_tests ()
160
169
return await self ._aggregate_benchmark_results ()
161
170
162
- async def run_build_only (self ):
163
- """Populate test app src and assemble apks."""
164
- await self ._create_benchmark_projects ()
165
- await self ._assemble_benchmark_apks ()
166
-
167
171
async def _create_benchmark_projects (self ):
168
172
app_name = self .test_app_config ['name' ]
169
173
self .logger .info (f'Creating test app "{ app_name } "...' )
@@ -176,6 +180,7 @@ async def _create_benchmark_projects(self):
176
180
renderer = pystache .Renderer ()
177
181
mustaches = glob .glob ('**/*.mustache' , recursive = True )
178
182
for mustache in mustaches :
183
+ self .logger .info (f'Processing mustache template: { mustache } ...' )
179
184
result = renderer .render_path (mustache , mustache_context )
180
185
original_name = mustache .removesuffix ('.mustache' )
181
186
with open (original_name , 'w' ) as file :
0 commit comments