@@ -52,23 +52,23 @@ def macrobenchmark(build_only):
52
52
async def _launch_macrobenchmark_test (build_only ):
53
53
_logger .info ('Starting macrobenchmark test...' )
54
54
55
- artifact_versions , config , test_dir = await asyncio .gather (
56
- _assemble_all_artifacts (),
57
- _process_config_yaml (),
58
- _prepare_test_directory (),
59
- )
60
-
55
+ artifact_versions = await _assemble_all_artifacts ()
61
56
_logger .info (f'Artifact versions: { artifact_versions } ' )
57
+
58
+ test_dir = await _prepare_test_directory ()
62
59
_logger .info (f'Test app directory: { test_dir } ' )
63
60
64
- with chdir ( test_dir ):
65
- tests = [ MacrobenchmarkTest ( app , artifact_versions , os . getcwd (), test_dir ) for app in config [ 'test-apps' ]]
61
+ config = await _process_config_yaml ()
62
+ _logger . info ( f'Processed yaml configurations: { config } ' )
66
63
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 )
71
- await _post_processing (results )
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
+
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 )
71
+ await _post_processing (results )
72
72
73
73
_logger .info ('Macrobenchmark test finished.' )
74
74
@@ -90,8 +90,12 @@ async def _process_config_yaml():
90
90
with open ('health-metrics/benchmark/config.yaml' ) as yaml_file :
91
91
config = yaml .safe_load (yaml_file )
92
92
for app in config ['test-apps' ]:
93
+ app ['plugins' ] = app .get ('plugins' , [])
94
+ app ['traces' ] = app .get ('traces' , [])
93
95
app ['plugins' ].extend (config ['common-plugins' ])
94
96
app ['traces' ].extend (config ['common-traces' ])
97
+
98
+ # Adding an empty android app for baseline comparison
95
99
config ['test-apps' ].append ({'sdk' : 'baseline' , 'name' : 'baseline' })
96
100
return config
97
101
@@ -142,8 +146,8 @@ def __init__(
142
146
self .artifact_versions = artifact_versions
143
147
self .repo_root_dir = repo_root_dir
144
148
self .test_dir = test_dir
145
- self .logger = MacrobenchmarkLoggerAdapter (logger , test_app_config . sdk )
146
- self .test_app_dir = os .path .join (test_dir , test_app_config . name )
149
+ self .logger = MacrobenchmarkLoggerAdapter (logger , test_app_config [ ' sdk' ] )
150
+ self .test_app_dir = os .path .join (test_dir , test_app_config [ ' name' ] )
147
151
self .test_results_bucket = 'fireescape-benchmark-results'
148
152
self .test_results_dir = str (uuid .uuid4 ())
149
153
self .gcs_client = storage .Client ()
@@ -180,7 +184,8 @@ async def _create_benchmark_projects(self):
180
184
async def _assemble_benchmark_apks (self ):
181
185
executable = './gradlew'
182
186
args = ['assemble' , '--project-dir' , self .test_app_dir ]
183
- await self ._exec_subprocess (executable , args )
187
+ with chdir (self .test_dir ):
188
+ await self ._exec_subprocess (executable , args )
184
189
185
190
async def _execute_benchmark_tests (self ):
186
191
self .logger .debug (glob .glob (f'{ self .test_app_dir } /**/*.apk' , recursive = True ))
@@ -217,7 +222,7 @@ async def _execute_benchmark_tests(self):
217
222
async def _prepare_mustache_context (self ):
218
223
mustache_context = {
219
224
'm2repository' : os .path .join (self .repo_root_dir , 'build/m2repository' ),
220
- 'plugins' : self .test_app_config [ 'plugins' ] ,
225
+ 'plugins' : self .test_app_config . get ( 'plugins' , []) ,
221
226
'dependencies' : [],
222
227
}
223
228
0 commit comments