Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Commit

Permalink
submit_tuxsuite: add support to submit Android build result
Browse files Browse the repository at this point in the history
with using the build_config value as environment

Signed-off-by: Yongqin Liu <[email protected]>
  • Loading branch information
liuyq committed Sep 5, 2023
1 parent 054f4ec commit 27ed89d
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions squad_client/commands/submit_tuxsuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,20 @@ def _generate_job_id(self, result_type, result):
uid = result['uid']
return f'{_type}:{project}#{uid}'

def _get_env_slug(self, result, result_type):
env_key = lambda result_type: 'device' if result_type == 'tests' else 'target_arch'
if result.get(env_key(result_type)) is None and \
result_type == "builds" and \
result.get("sources") and \
result.get("sources").get("android") and \
result.get("sources").get("android").get("build_config"):
# for Android builds case
env_slug = result.get("sources").get("android").get("build_config")
env_slug = env_slug.replace('/', '_').replace(":", '_')
else:
env_slug = result[env_key(result_type)]
return env_slug

def run(self, args):
"""
Submitting TuxSuite results to SQUAD basically consists of:
Expand All @@ -102,7 +116,6 @@ def run(self, args):
logger.error("Failed to retrieve tuxsuite build: %s" % e)
return False

env_key = lambda result_type: 'device' if result_type == 'tests' else 'target_arch' # noqa
for result_type in ['builds', 'tests']:
num_watching_jobs = 0
for result in results[result_type].values():
Expand All @@ -112,7 +125,7 @@ def run(self, args):
watchjob(
group_project_slug='%s/%s' % (args.group, args.project),
build_version=build,
env_slug=result[env_key(result_type)],
env_slug=self._get_env_slug(result, result_type),
backend_name=args.backend,
testjob_id=job_id,
)
Expand Down

0 comments on commit 27ed89d

Please sign in to comment.