13from compatibility_helper
import byte_str_decode
15if 'STORAGE_BUCKET' not in os.environ:
16 print(
'The GCP storage bucket must be provided as an environment variable.')
18BUCKET = os.environ[
'STORAGE_BUCKET']
20if 'GCP_PROJECT' not in os.environ:
21 print(
'The GCP project must be provided as an environment variable.')
23PROJECT = os.environ[
'GCP_PROJECT']
26FTL_INFRA_FAILURE_CODES = [1, 15, 20]
31script_dir = os.path.dirname(os.path.realpath(__file__))
32buildroot_dir = os.path.abspath(os.path.join(script_dir,
'..',
'..'))
33out_dir = os.path.join(buildroot_dir,
'out')
34error_re = re.compile(
r'[EF]/flutter.+')
43 process = subprocess.Popen(
63 'model=shiba,version=34',
65 stdout=subprocess.PIPE,
66 stderr=subprocess.STDOUT,
67 universal_newlines=
True,
73 logcat = subprocess.check_output([
'gsutil',
'cat',
'%s/%s/*/logcat' % (BUCKET, results_dir)])
78 logcat_matches = error_re.findall(logcat)
80 print(
'Errors in logcat:')
86 gsutil_du = subprocess.check_output([
88 '%s/%s/*/game_loop_results/results_scenario_0.json' % (BUCKET, results_dir)
91 gsutil_du = gsutil_du.strip()
93 print(
'Failed to produce a timeline.')
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)
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)
163if __name__ ==
'__main__':
def byte_str_decode(str_or_bytes)
def run_firebase_test(apk, results_dir)
def check_timeline(results_dir)
def check_logcat(results_dir)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set
def print(*args, **kwargs)