98 parser = argparse.ArgumentParser()
103 default=
'android_profile_arm64',
104 help=
'The engine variant to run tests for.'
108 default=os.environ.get(
'SWARMING_TASK_ID',
'local_test'),
109 help=
'A unique build identifier for this test. Used to sort results in the GCS bucket.'
112 args = parser.parse_args()
114 apks_dir = os.path.join(out_dir, args.variant,
'firebase_apks')
115 apks = set(glob.glob(
'%s/*.apk' % apks_dir))
118 print(
'No APKs found at %s' % apks_dir)
121 git_revision = subprocess.check_output([
'git',
'rev-parse',
'HEAD'], cwd=script_dir)
122 git_revision = byte_str_decode(git_revision)
123 git_revision = git_revision.strip()
125 for retry
in range(MAX_RETRY_ATTEMPTS):
127 print(
'Retrying %s' % apks)
130 for apk
in sorted(apks):
131 results_dir =
'%s/%s/%s' % (os.path.basename(apk), git_revision, args.build_id)
133 results.append((apk, results_dir, process))
135 for apk, results_dir, process
in results:
136 print(
'===== Test output for %s' % apk)
137 for line
in iter(process.stdout.readline,
''):
140 return_code = process.wait()
141 if return_code
in FTL_INFRA_FAILURE_CODES:
142 print(
'Firebase test %s failed with infrastructure error code: %s' % (apk, return_code))
145 print(
'Firebase test %s failed with code: %s' % (apk, return_code))
146 sys.exit(return_code)
148 print(
'Checking logcat for %s' % results_dir)
151 if 'scenario' in apk:
152 print(
'Checking timeline for %s' % results_dir)