pw_unit_test: Provide TestMetadata to ResultDB

This will result in nicer names in the TestResult panel. See
https://bugs.chromium.org/p/chromium/issues/detail?id=1368387#c6

Bug: 247857184
Change-Id: I977a0c7c341bf415dc54cfc120d3a86d23470eeb
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/112315
Reviewed-by: Alexei Frolov <frolv@google.com>
Pigweed-Auto-Submit: Ted Pudlik <tpudlik@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
diff --git a/pw_unit_test/py/pw_unit_test/test_runner.py b/pw_unit_test/py/pw_unit_test/test_runner.py
index 816790f..0d49ff9 100644
--- a/pw_unit_test/py/pw_unit_test/test_runner.py
+++ b/pw_unit_test/py/pw_unit_test/test_runner.py
@@ -235,6 +235,13 @@
             # like '1.1e-10', which is an invalid input for
             # google.protobuf.duration.
             "duration": "%.9fs" % test.duration_s,
+            "testMetadata": {
+                # Use the file path as the test name in the Milo UI. (If this is
+                # left unspecified, the UI will attempt to build a "good enough"
+                # name by truncating the testId. That produces less readable
+                # results.)
+                "name": test.file_path,
+            },
             "summaryHtml":
             '<p><text-artifact artifact-id="artifact-content-in-request"></p>',
             "artifacts": {