Commit e8bb8de8 authored by Ben Pastene's avatar Ben Pastene Committed by Commit Bot

chromeos: Add basic RDB integration for all Tast results.

This uses //build/android's result_sink.py to upload Tast results to
RDB. It attaches any file artifact for a given test that Tast produces.

Bug: 1129654
Change-Id: I8f00cbe5b03521d7875d66c062d5832be80caa6b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2504493Reviewed-by: default avatarBrian Sheedy <bsheedy@chromium.org>
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821863}
parent cdfdde1a
......@@ -30,6 +30,7 @@ CHROMIUM_SRC_PATH = os.path.abspath(
# output json ourselves.
sys.path.insert(0, os.path.join(CHROMIUM_SRC_PATH, 'build', 'android'))
from pylib.base import base_test_result # pylint: disable=import-error
from pylib.base import result_sink # pylint: disable=import-error
from pylib.results import json_results # pylint: disable=import-error
import subprocess32 as subprocess # pylint: disable=import-error
......@@ -87,6 +88,7 @@ class RemoteTest(object):
self._test_launcher_summary_output = args.test_launcher_summary_output
self._logs_dir = args.logs_dir
self._use_vm = args.use_vm
self._rdb_client = result_sink.TryInitClient()
self._retries = 0
self._timeout = None
......@@ -375,6 +377,21 @@ class TastTest(RemoteTest):
suite_results.AddResult(base_result)
self._maybe_handle_perf_results(test['name'])
if self._rdb_client:
# Walk the contents of the test's "outDir" and atttach any file found
# inside as an RDB 'artifact'. (This could include system logs, screen
# shots, etc.)
artifacts = {}
artifacts_dir = test['outDir']
for dirpath, _, filenames in os.walk(artifacts_dir):
for f in filenames:
artifact_path = os.path.join(dirpath, f)
artifacts[os.path.relpath(artifact_path, artifacts_dir)] = {
'filePath': artifact_path,
}
self._rdb_client.Post(test['name'], result, error_log, artifacts)
if self._test_launcher_summary_output:
with open(self._test_launcher_summary_output, 'w') as f:
json.dump(json_results.GenerateResultsDict([suite_results]), f)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment