Commit 968749bf authored by Juan Antonio Navarro Perez's avatar Juan Antonio Navarro Perez Committed by Commit Bot

[results_processor] Simplify artifact creation in processor_test.py

Make it slightly easier to write integration tests for results
processor involving artifacts.

Also fix a bug where creating multiple artifacts of the same type
(e.g. many histogram artifacts for different test runs) would
write all of them to the same file name, causing them to get
overwritten.

Bug: 981349
Change-Id: I7eaa8793d09fe0afc869dd8154df628d9ece7774
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1880034
Commit-Queue: Juan Antonio Navarro Pérez <perezju@chromium.org>
Reviewed-by: default avatarCaleb Rouleau <crouleau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710278}
parent 6655884a
......@@ -25,7 +25,8 @@ def TestResult(test_path, status='PASS', is_expected=None,
start_time: An optional UTC timestamp recording when the test run started.
run_duration: An optional duration string recording the amount of time
that the test run lasted.
artifcats: An optional dict mapping artifact names to Artifact dicts.
output_artifacts: An optional mapping of artifact names to Artifact dicts,
may be given as a dict or a sequence of pairs.
tags: An optional sequence of tags associated with this test run; each
tag is given as a '{key}:{value}' string. Keys are not unique, the same
key may appear multiple times.
......@@ -43,7 +44,7 @@ def TestResult(test_path, status='PASS', is_expected=None,
'runDuration': run_duration
}
if output_artifacts is not None:
test_result['outputArtifacts'] = output_artifacts
test_result['outputArtifacts'] = dict(output_artifacts)
if tags is not None:
test_result['tags'] = [_SplitTag(tag) for tag in tags]
......
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