Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: mojo/tools/apptest_runner.py

Issue 1918143004: Convert Mojo tests to use swarming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/mojo_application_manifest.gni ('k') | services/catalog/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/tools/apptest_runner.py
diff --git a/mojo/tools/apptest_runner.py b/mojo/tools/apptest_runner.py
index 6494db73cb1f8dee538345343d56b32f0967bdfb..7fa0aba27c889748dd1aafea2ea8e630e9b34655 100755
--- a/mojo/tools/apptest_runner.py
+++ b/mojo/tools/apptest_runner.py
@@ -30,6 +30,8 @@ def main():
help='The number of times to repeat the set of tests.')
parser.add_argument('--write-full-results-to', metavar='FILENAME',
help='The path to write the JSON list of full results.')
+ parser.add_argument('--test-launcher-summary-output', metavar='FILENAME',
+ help='The path to write the JSON list of full results.')
parser.add_argument('--test-list-file', metavar='FILENAME', type=file,
default=APPTESTS, help='The file listing tests to run.')
parser.add_argument('--apptest-filter', default='',
@@ -112,6 +114,8 @@ def main():
if args.write_full_results_to:
_WriteJSONResults(tests, failed, args.write_full_results_to)
+ if args.test_launcher_summary_output:
+ _WriteSwarmingJSONResults(tests, failed, args.test_launcher_summary_output)
return 1 if failed else 0
@@ -160,5 +164,30 @@ def _AddPathToTrie(trie, path, value):
_AddPathToTrie(trie[directory], rest, value)
+def _WriteSwarmingJSONResults(tests, failed, write_full_results_to):
+ '''Writes the test results in the JSON test result format used by swarming.'''
+ results = {
+ 'all_tests': tests,
+ 'disabled_tests': [],
+ 'global_tags': [],
+ }
+
+ test_results = []
+ for test in sorted(tests):
+ value = [{
+ 'status': 'FAILURE' if test in failed else 'SUCCESS',
+ 'output_snippet': '',
+ 'output_snippet_base64': '',
+ }]
+ test_results.append({test: value})
+ results['per_iteration_data'] = test_results
+
+ with open(write_full_results_to, 'w') as fp:
+ json.dump(results, fp, indent=2)
+ fp.write('\n')
+
+ return results
+
+
if __name__ == '__main__':
sys.exit(main())
« no previous file with comments | « mojo/public/mojo_application_manifest.gni ('k') | services/catalog/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698