|
19 | 19 |
|
20 | 20 |
|
21 | 21 | def RunFirebaseTest(apk, results_dir): |
22 | | - # game-loop tests are meant for OpenGL apps. |
23 | | - # This type of test will give the application a handle to a file, and |
24 | | - # we'll write the timeline JSON to that file. |
25 | | - # See https://firebase.google.com/docs/test-lab/android/game-loop |
26 | | - # Pixel 4. As of this commit, this is a highly available device in FTL. |
27 | | - process = subprocess.Popen( |
28 | | - [ |
29 | | - 'gcloud', |
30 | | - '--project', 'flutter-infra', |
31 | | - 'firebase', 'test', 'android', 'run', |
32 | | - '--type', 'game-loop', |
33 | | - '--app', apk, |
34 | | - '--timeout', '2m', |
35 | | - '--results-bucket', bucket, |
36 | | - '--results-dir', results_dir, |
37 | | - '--device', 'model=flame,version=29', |
38 | | - ], |
39 | | - stdout=subprocess.PIPE, |
40 | | - stderr=subprocess.STDOUT, |
41 | | - universal_newlines=True, |
42 | | - ) |
43 | | - return process |
| 22 | + try: |
| 23 | + # game-loop tests are meant for OpenGL apps. |
| 24 | + # This type of test will give the application a handle to a file, and |
| 25 | + # we'll write the timeline JSON to that file. |
| 26 | + # See https://firebase.google.com/docs/test-lab/android/game-loop |
| 27 | + # Pixel 4. As of this commit, this is a highly available device in FTL. |
| 28 | + subprocess.check_output([ |
| 29 | + 'gcloud', |
| 30 | + '--project', 'flutter-infra', |
| 31 | + 'firebase', 'test', 'android', 'run', |
| 32 | + '--type', 'game-loop', |
| 33 | + '--app', apk, |
| 34 | + '--timeout', '2m', |
| 35 | + '--results-bucket', bucket, |
| 36 | + '--results-dir', results_dir, |
| 37 | + '--device', 'model=flame,version=29', |
| 38 | + ]) |
| 39 | + except subprocess.CalledProcessError as ex: |
| 40 | + print(ex.output) |
| 41 | + # Recipe will retry return codes from firebase that indicate an infra |
| 42 | + # failure. |
| 43 | + sys.exit(ex.returncode) |
44 | 44 |
|
45 | 45 |
|
46 | 46 | def CheckLogcat(results_dir): |
@@ -87,25 +87,13 @@ def main(): |
87 | 87 | git_revision = subprocess.check_output( |
88 | 88 | ['git', 'rev-parse', 'HEAD'], cwd=script_dir).strip() |
89 | 89 |
|
90 | | - results = [] |
91 | 90 | for apk in apks: |
92 | 91 | results_dir = '%s/%s/%s' % (os.path.basename(apk), git_revision, args.build_id) |
93 | | - process = RunFirebaseTest(apk, results_dir) |
94 | | - results.append((results_dir, process)) |
95 | | - |
96 | | - for results_dir, process in results: |
97 | | - for line in iter(process.stdout.readline, ""): |
98 | | - print(line.strip()) |
99 | | - return_code = process.wait() |
100 | | - if return_code != 0: |
101 | | - print('Firebase test failed ' + returncode) |
102 | | - sys.exit(process.returncode) |
103 | | - |
104 | | - print('Checking logcat for %s' % results_dir) |
| 92 | + |
| 93 | + RunFirebaseTest(apk, results_dir) |
105 | 94 | CheckLogcat(results_dir) |
106 | 95 | # scenario_app produces a timeline, but the android image test does not. |
107 | 96 | if 'scenario' in apk: |
108 | | - print('Checking timeline for %s' % results_dir) |
109 | 97 | CheckTimeline(results_dir) |
110 | 98 |
|
111 | 99 | return 0 |
|
0 commit comments