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

Unified Diff: scripts/slave/recipe_modules/json/test_api.py

Issue 674023002: Fix name/path separator for telemetry_unittests test names. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: fix --no-find-copies Created 6 years, 2 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 | « scripts/slave/recipe_modules/json/api.py ('k') | scripts/slave/recipe_modules/json/util.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/recipe_modules/json/test_api.py
diff --git a/scripts/slave/recipe_modules/json/test_api.py b/scripts/slave/recipe_modules/json/test_api.py
index 9a032b167ef113e70ff364329e72637f542144cb..73ebdee4903a653b0fab88277f1749458df2f028 100644
--- a/scripts/slave/recipe_modules/json/test_api.py
+++ b/scripts/slave/recipe_modules/json/test_api.py
@@ -10,14 +10,13 @@ class JsonTestApi(recipe_test_api.RecipeTestApi):
def output(data, retcode=None):
return json.dumps(data), retcode
- # TODO(phajdan.jr): Rename to layout_test_results.
@recipe_test_api.placeholder_step_data
def test_results(self, test_results, retcode=None):
return self.output(test_results.as_jsonish(), retcode)
- # TODO(phajdan.jr): Rename to canned_layout_test_output.
def canned_test_output(self, passing, minimal=False, passes=9001,
num_additional_failures=0,
+ path_separator=None,
retcode=None):
"""Produces a 'json test results' compatible object with some canned tests.
Args:
@@ -30,22 +29,25 @@ class JsonTestApi(recipe_test_api.RecipeTestApi):
"""
if_failing = lambda fail_val: None if passing else fail_val
t = TestResults()
+ sep = path_separator or '/'
+ if path_separator:
+ t.raw['path_separator'] = path_separator
t.raw['num_passes'] = passes
t.raw['num_regressions'] = 0
- t.add_result('flake/totally-flakey.html', 'PASS',
+ t.add_result('flake%stotally-flakey.html' % sep, 'PASS',
if_failing('TIMEOUT PASS'))
- t.add_result('flake/timeout-then-crash.html', 'CRASH',
+ t.add_result('flake%stimeout-then-crash.html' % sep, 'CRASH',
if_failing('TIMEOUT CRASH'))
- t.add_result('flake/slow.html', 'SLOW',
+ t.add_result('flake%sslow.html' % sep, 'SLOW',
if_failing('TIMEOUT SLOW'))
- t.add_result('tricky/totally-maybe-not-awesome.html', 'PASS',
+ t.add_result('tricky%stotally-maybe-not-awesome.html' % sep, 'PASS',
if_failing('FAIL'))
- t.add_result('bad/totally-bad-probably.html', 'PASS',
+ t.add_result('bad%stotally-bad-probably.html' % sep, 'PASS',
if_failing('FAIL'))
if not minimal:
- t.add_result('good/totally-awesome.html', 'PASS')
+ t.add_result('good%stotally-awesome.html' % sep, 'PASS')
for i in xrange(num_additional_failures):
- t.add_result('bad/failing%d.html' %i, 'PASS', 'FAIL')
+ t.add_result('bad%sfailing%d.html' % (sep, i), 'PASS', 'FAIL')
ret = self.test_results(t)
if retcode is not None:
ret.retcode = retcode
« no previous file with comments | « scripts/slave/recipe_modules/json/api.py ('k') | scripts/slave/recipe_modules/json/util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698