Skip to content

Commit 37b4103

Browse files
committed
wip
1 parent 810cbbd commit 37b4103

File tree

4 files changed

+30
-24
lines changed

4 files changed

+30
-24
lines changed

ci/fireci/fireciplugins/macrobenchmark.py

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,23 @@ def macrobenchmark(build_only):
5252
async def _launch_macrobenchmark_test(build_only):
5353
_logger.info('Starting macrobenchmark test...')
5454

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()
6156
_logger.info(f'Artifact versions: {artifact_versions}')
57+
58+
test_dir = await _prepare_test_directory()
6259
_logger.info(f'Test app directory: {test_dir}')
6360

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}')
6663

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)
7272

7373
_logger.info('Macrobenchmark test finished.')
7474

@@ -90,8 +90,12 @@ async def _process_config_yaml():
9090
with open('health-metrics/benchmark/config.yaml') as yaml_file:
9191
config = yaml.safe_load(yaml_file)
9292
for app in config['test-apps']:
93+
app['plugins'] = app.get('plugins', [])
94+
app['traces'] = app.get('traces', [])
9395
app['plugins'].extend(config['common-plugins'])
9496
app['traces'].extend(config['common-traces'])
97+
98+
# Adding an empty android app for baseline comparison
9599
config['test-apps'].append({'sdk': 'baseline', 'name': 'baseline'})
96100
return config
97101

@@ -142,8 +146,8 @@ def __init__(
142146
self.artifact_versions = artifact_versions
143147
self.repo_root_dir = repo_root_dir
144148
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'])
147151
self.test_results_bucket = 'fireescape-benchmark-results'
148152
self.test_results_dir = str(uuid.uuid4())
149153
self.gcs_client = storage.Client()
@@ -180,7 +184,8 @@ async def _create_benchmark_projects(self):
180184
async def _assemble_benchmark_apks(self):
181185
executable = './gradlew'
182186
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)
184189

185190
async def _execute_benchmark_tests(self):
186191
self.logger.debug(glob.glob(f'{self.test_app_dir}/**/*.apk', recursive=True))
@@ -217,7 +222,7 @@ async def _execute_benchmark_tests(self):
217222
async def _prepare_mustache_context(self):
218223
mustache_context = {
219224
'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', []),
221226
'dependencies': [],
222227
}
223228

health-metrics/benchmark/README.md

Whitespace-only changes.

health-metrics/benchmark/config.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ test-apps:
4343
- sdk: firebase-functions
4444
name: functions
4545
dependencies: [com.google.firebase:firebase-functions-ktx]
46-
- sdk: firebase-inappmessaging-display
47-
name: fiam
48-
dependencies:
49-
- com.google.firebase:[email protected]
50-
- com.google.firebase:firebase-inappmessaging-ktx
51-
- com.google.firebase:firebase-inappmessaging-display-ktx
46+
# TODO(yifany): disable temporarily due to errors of duplicate class and gradle crash
47+
# - sdk: firebase-inappmessaging-display
48+
# name: fiam
49+
# dependencies:
50+
# - com.google.firebase:[email protected]
51+
# - com.google.firebase:firebase-inappmessaging-ktx
52+
# - com.google.firebase:firebase-inappmessaging-display-ktx
5253
- sdk: firebase-messaging
5354
name: message
5455
dependencies: [com.google.firebase:firebase-messaging-ktx]

health-metrics/benchmark/template/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# http://www.gradle.org/docs/current/userguide/build_environment.html
2121
# Specifies the JVM arguments used for the daemon process.
2222
# The setting is particularly useful for tweaking memory settings.
23-
org.gradle.jvmargs=-Xmx512m -Xms256m -Dfile.encoding=UTF-8
23+
org.gradle.jvmargs=-Xmx1024m -Xms512m -Dfile.encoding=UTF-8
2424
# When configured, Gradle will run in incubating parallel mode.
2525
# This option should only be used with decoupled projects. More details, visit
2626
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects

0 commit comments

Comments
 (0)