Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2017 The Chromium Authors. All rights reserved. | 1 # Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import json | 5 import json |
| 6 | 6 |
| 7 from dashboard.pinpoint.models import quest as quest_module | 7 from dashboard.pinpoint.models import quest as quest_module |
| 8 | 8 |
| 9 | 9 |
| 10 _DEFAULT_REPEAT_COUNT = 10 | 10 _DEFAULT_REPEAT_COUNT = 10 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 if not benchmark: | 77 if not benchmark: |
| 78 raise TypeError('Missing "benchmark" argument.') | 78 raise TypeError('Missing "benchmark" argument.') |
| 79 arguments['benchmark'] = benchmark | 79 arguments['benchmark'] = benchmark |
| 80 swarming_extra_args.append(benchmark) | 80 swarming_extra_args.append(benchmark) |
| 81 | 81 |
| 82 story = request.get('story') | 82 story = request.get('story') |
| 83 if story: | 83 if story: |
| 84 arguments['story'] = story | 84 arguments['story'] = story |
| 85 swarming_extra_args += ('--story-filter', story) | 85 swarming_extra_args += ('--story-filter', story) |
| 86 | 86 |
| 87 repeat_count = request.get('repeat_count') | 87 # TODO: Workaround for crbug.com/677843. |
| 88 if repeat_count: | 88 if (benchmark.startswith('startup.warm') or |
| 89 arguments['repeat_count'] = repeat_count | 89 benchmark.startswith('start_with_url.warm')): |
| 90 swarming_extra_args += ('--pageset-repeat', '2') | |
|
perezju
2017/09/06 14:24:56
ugh :(
Just saw that bug. Hope that gets eventual
| |
| 90 else: | 91 else: |
| 91 repeat_count = str(_DEFAULT_REPEAT_COUNT) | 92 swarming_extra_args += ('--pageset-repeat', '1') |
| 92 swarming_extra_args += ('--pageset-repeat', repeat_count) | |
| 93 | 93 |
| 94 browser = request.get('browser') | 94 browser = request.get('browser') |
| 95 if not browser: | 95 if not browser: |
| 96 raise TypeError('Missing "browser" argument.') | 96 raise TypeError('Missing "browser" argument.') |
| 97 arguments['browser'] = browser | 97 arguments['browser'] = browser |
| 98 swarming_extra_args += ('--browser', browser) | 98 swarming_extra_args += ('--browser', browser) |
| 99 | 99 |
| 100 swarming_extra_args += ('-v', '--upload-results', | 100 swarming_extra_args += ('-v', '--upload-results', |
| 101 '--output-format', 'chartjson') | 101 '--output-format', 'chartjson') |
| 102 swarming_extra_args += _SWARMING_EXTRA_ARGS | 102 swarming_extra_args += _SWARMING_EXTRA_ARGS |
| 103 | 103 |
| 104 return arguments, quest_module.RunTest(dimensions, swarming_extra_args) | 104 return arguments, quest_module.RunTest(dimensions, swarming_extra_args) |
| 105 | 105 |
| 106 | 106 |
| 107 def _GTestRunTest(request): | 107 def _GTestRunTest(request): |
| 108 arguments = {} | 108 arguments = {} |
| 109 swarming_extra_args = [] | 109 swarming_extra_args = [] |
| 110 | 110 |
| 111 dimensions = request.get('dimensions') | 111 dimensions = request.get('dimensions') |
| 112 if not dimensions: | 112 if not dimensions: |
| 113 return {}, None | 113 return {}, None |
| 114 dimensions = json.loads(dimensions) | 114 dimensions = json.loads(dimensions) |
| 115 arguments['dimensions'] = json.dumps(dimensions) | 115 arguments['dimensions'] = json.dumps(dimensions) |
| 116 | 116 |
| 117 test = request.get('test') | 117 test = request.get('test') |
| 118 if test: | 118 if test: |
| 119 arguments['test'] = test | 119 arguments['test'] = test |
| 120 swarming_extra_args.append('--gtest_filter=' + test) | 120 swarming_extra_args.append('--gtest_filter=' + test) |
| 121 | 121 |
| 122 repeat_count = request.get('repeat_count') | 122 swarming_extra_args.append('--gtest_repeat=1') |
| 123 if repeat_count: | |
| 124 arguments['repeat_count'] = repeat_count | |
| 125 else: | |
| 126 repeat_count = str(_DEFAULT_REPEAT_COUNT) | |
| 127 swarming_extra_args.append('--gtest_repeat=' + repeat_count) | |
| 128 | 123 |
| 129 swarming_extra_args += _SWARMING_EXTRA_ARGS | 124 swarming_extra_args += _SWARMING_EXTRA_ARGS |
| 130 | 125 |
| 131 return arguments, quest_module.RunTest(dimensions, swarming_extra_args) | 126 return arguments, quest_module.RunTest(dimensions, swarming_extra_args) |
| 132 | 127 |
| 133 | 128 |
| 134 def _ReadChartJsonValue(request): | 129 def _ReadChartJsonValue(request): |
| 135 arguments = {} | 130 arguments = {} |
| 136 | 131 |
| 137 chart = request.get('chart') | 132 chart = request.get('chart') |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 158 if not (chart or trace): | 153 if not (chart or trace): |
| 159 return {}, None | 154 return {}, None |
| 160 if chart and not trace: | 155 if chart and not trace: |
| 161 raise TypeError('"chart" specified but no "trace" given.') | 156 raise TypeError('"chart" specified but no "trace" given.') |
| 162 if trace and not chart: | 157 if trace and not chart: |
| 163 raise TypeError('"trace" specified but no "chart" given.') | 158 raise TypeError('"trace" specified but no "chart" given.') |
| 164 arguments['chart'] = chart | 159 arguments['chart'] = chart |
| 165 arguments['trace'] = trace | 160 arguments['trace'] = trace |
| 166 | 161 |
| 167 return arguments, quest_module.ReadGraphJsonValue(chart, trace) | 162 return arguments, quest_module.ReadGraphJsonValue(chart, trace) |
| OLD | NEW |