Reland "Optionally stream local script tests results to RDB."

This reverts commit 6de500ea61807200121acc0e9025f07f2797b3af.

Reason for revert: should be safe after crrev.com/c/2994798

Original change's description:
> Revert "Optionally stream local script tests results to RDB."
>
> This reverts commit 887a2025871bf80ee2ee5ec17904e0edc4166f40.
>
> Reason for revert: broke angle
>
> Original change's description:
> > Optionally stream local script tests results to RDB.
> >
> > The chromium recipe currently supports a "local script test" type. This
> > test type runs on the local machine (the same machine that runs the
> > build) and _doesn't_ conform to the isolated test script API. Namely,
> > it's missing args like "--isolated-script-test-output". Instead, local
> > script tests are expected to output their results to a simple json file
> > with keys "failures" and "valid".
> >
> > This encapsulates that format in a single method in
> > //testing/scripts/common.py and migrates all local script tests to use
> > that method. Additionally, this optionally uploads those results to RDB
> > using //build/android/pylib's result_sink utility.
> >
> > All local script tests affected are:
> >  - blink_lint_expectations.py
> >  - checkbins.py
> >  - checkdeps.py
> >  - check_network_annotations.py
> >  - checkperms.py
> >  - check_static_initializers.py
> >  - headless_python_unittests.py
> >  - metrics_python_tests.py
> >  - test_traffic_annotation_auditor.py
> >
> > Bug: 1135718
> > Change-Id: I93ba42f0899c81b78f4b64612ab8b48c39a0a708
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2977971
> > Reviewed-by: Andrew Grieve <[email protected]>
> > Reviewed-by: Dirk Pranke <[email protected]>
> > Commit-Queue: Ben Pastene <[email protected]>
> > Cr-Commit-Position: refs/heads/master@{#896578}
>
> Bug: 1135718
> Change-Id: I9fd8e85acafff949cbd1ee17593f250b1a4b7867
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2993851
> Bot-Commit: Rubber Stamper <[email protected]>
> Reviewed-by: W. James MacLean <[email protected]>
> Owners-Override: W. James MacLean <[email protected]>
> Commit-Queue: Ben Pastene <[email protected]>
> Cr-Commit-Position: refs/heads/master@{#896957}

Bug: 1135718
Change-Id: I11b5ee40d5eaa830755eaeb72e74ec6e3261cb4d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2998747
Reviewed-by: Dirk Pranke <[email protected]>
Commit-Queue: Ben Pastene <[email protected]>
Cr-Commit-Position: refs/heads/master@{#897797}
diff --git a/testing/scripts/metrics_python_tests.py b/testing/scripts/metrics_python_tests.py
index 206d1b3..72cecb85 100755
--- a/testing/scripts/metrics_python_tests.py
+++ b/testing/scripts/metrics_python_tests.py
@@ -28,11 +28,11 @@
   results = common.parse_common_test_results(isolated_results,
                                              test_separator='.')
 
-  json.dump({
-      'valid': True,
-      'failures': ['%s: %s' % (k, v)
-                   for k, v in results['unexpected_failures'].items()]
-  }, args.output)
+  failures = [
+      '%s: %s' % (k, v) for k, v in results['unexpected_failures'].items()
+  ]
+  common.record_local_script_results(
+      'metrics_python_tests', args.output, failures, True)
 
   return rc