Skip to content

Commit 810cbbd

Browse files
committed
what
1 parent ae48f6f commit 810cbbd

File tree

1 file changed

+14
-25
lines changed

1 file changed

+14
-25
lines changed

ci/fireci/fireciplugins/macrobenchmark.py

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -53,35 +53,27 @@ async def _launch_macrobenchmark_test(build_only):
5353
_logger.info('Starting macrobenchmark test...')
5454

5555
artifact_versions, config, test_dir = await asyncio.gather(
56-
_parse_artifact_versions(),
57-
_parse_config_yaml(),
56+
_assemble_all_artifacts(),
57+
_process_config_yaml(),
5858
_prepare_test_directory(),
5959
)
6060

6161
_logger.info(f'Artifact versions: {artifact_versions}')
6262
_logger.info(f'Test app directory: {test_dir}')
6363

64-
repo_root_dir = os.getcwd()
6564
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']]
7466

7567
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])
7769
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)
7971
await _post_processing(results)
8072

8173
_logger.info('Macrobenchmark test finished.')
8274

8375

84-
async def _parse_artifact_versions():
76+
async def _assemble_all_artifacts():
8577
await (await asyncio.create_subprocess_exec('./gradlew', 'assembleAllForSmokeTests')).wait()
8678

8779
with open('build/m2repository/changed-artifacts.json') as json_file:
@@ -94,9 +86,14 @@ def _artifact_key_version(artifact):
9486
return f'{group_id}:{artifact_id}', version
9587

9688

97-
async def _parse_config_yaml():
89+
async def _process_config_yaml():
9890
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
10097

10198

10299
async def _prepare_test_directory():
@@ -218,20 +215,12 @@ async def _execute_benchmark_tests(self):
218215
await self._exec_subprocess(executable, args)
219216

220217
async def _prepare_mustache_context(self):
221-
app_name = self.test_app_config['name']
222-
223218
mustache_context = {
224219
'm2repository': os.path.join(self.repo_root_dir, 'build/m2repository'),
225-
'plugins': [],
220+
'plugins': self.test_app_config['plugins'],
226221
'dependencies': [],
227222
}
228223

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-
235224
if 'dependencies' in self.test_app_config:
236225
for dep in self.test_app_config['dependencies']:
237226
if '@' in dep:

0 commit comments

Comments
 (0)