@@ -53,35 +53,27 @@ async def _launch_macrobenchmark_test(build_only):
53
53
_logger .info ('Starting macrobenchmark test...' )
54
54
55
55
artifact_versions , config , test_dir = await asyncio .gather (
56
- _parse_artifact_versions (),
57
- _parse_config_yaml (),
56
+ _assemble_all_artifacts (),
57
+ _process_config_yaml (),
58
58
_prepare_test_directory (),
59
59
)
60
60
61
61
_logger .info (f'Artifact versions: { artifact_versions } ' )
62
62
_logger .info (f'Test app directory: { test_dir } ' )
63
63
64
- repo_root_dir = os .getcwd ()
65
64
with chdir (test_dir ):
66
- benchmark_tests = [
67
- MacrobenchmarkTest (
68
- test_app_config ,
69
- artifact_versions ,
70
- repo_root_dir ,
71
- test_dir ,
72
- ) for test_app_config in config ['test-apps' ]
73
- ]
65
+ tests = [MacrobenchmarkTest (app , artifact_versions , os .getcwd (), test_dir ) for app in config ['test-apps' ]]
74
66
75
67
if build_only :
76
- await asyncio .gather (* [x .run_build_only () for x in benchmark_tests ])
68
+ await asyncio .gather (* [x .run_build_only () for x in tests ])
77
69
else :
78
- results = await asyncio .gather (* [x .run () for x in benchmark_tests ], return_exceptions = True )
70
+ results = await asyncio .gather (* [x .run () for x in tests ], return_exceptions = True )
79
71
await _post_processing (results )
80
72
81
73
_logger .info ('Macrobenchmark test finished.' )
82
74
83
75
84
- async def _parse_artifact_versions ():
76
+ async def _assemble_all_artifacts ():
85
77
await (await asyncio .create_subprocess_exec ('./gradlew' , 'assembleAllForSmokeTests' )).wait ()
86
78
87
79
with open ('build/m2repository/changed-artifacts.json' ) as json_file :
@@ -94,9 +86,14 @@ def _artifact_key_version(artifact):
94
86
return f'{ group_id } :{ artifact_id } ' , version
95
87
96
88
97
- async def _parse_config_yaml ():
89
+ async def _process_config_yaml ():
98
90
with open ('health-metrics/benchmark/config.yaml' ) as yaml_file :
99
- return yaml .safe_load (yaml_file )
91
+ config = yaml .safe_load (yaml_file )
92
+ for app in config ['test-apps' ]:
93
+ app ['plugins' ].extend (config ['common-plugins' ])
94
+ app ['traces' ].extend (config ['common-traces' ])
95
+ config ['test-apps' ].append ({'sdk' : 'baseline' , 'name' : 'baseline' })
96
+ return config
100
97
101
98
102
99
async def _prepare_test_directory ():
@@ -218,20 +215,12 @@ async def _execute_benchmark_tests(self):
218
215
await self ._exec_subprocess (executable , args )
219
216
220
217
async def _prepare_mustache_context (self ):
221
- app_name = self .test_app_config ['name' ]
222
-
223
218
mustache_context = {
224
219
'm2repository' : os .path .join (self .repo_root_dir , 'build/m2repository' ),
225
- 'plugins' : [ ],
220
+ 'plugins' : self . test_app_config [ 'plugins' ],
226
221
'dependencies' : [],
227
222
}
228
223
229
- if app_name != 'baseline' :
230
- mustache_context ['plugins' ].append ('com.google.gms.google-services' )
231
-
232
- if 'plugins' in self .test_app_config :
233
- mustache_context ['plugins' ].extend (self .test_app_config ['plugins' ])
234
-
235
224
if 'dependencies' in self .test_app_config :
236
225
for dep in self .test_app_config ['dependencies' ]:
237
226
if '@' in dep :
0 commit comments