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

Side by Side Diff: tools/perf/core/trybot_command_unittest.py

Issue 2874853002: New bisect for crbug.com/706941. [AA_AutofillCreditCardSigninPromo]
Patch Set: Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « tools/perf/core/trybot_command.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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 import argparse 4 import argparse
5 import base64 5 import base64
6 import io 6 import io
7 import gzip 7 import gzip
8 import json 8 import json
9 import logging 9 import logging
10 import os 10 import os
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 return command, opts 121 return command, opts
122 122
123 def _GetConfigForTrybot(self, name, platform, extra_benchmark_args=None, 123 def _GetConfigForTrybot(self, name, platform, extra_benchmark_args=None,
124 repo_path=trybot_command.CHROMIUM_SRC_PATH, 124 repo_path=trybot_command.CHROMIUM_SRC_PATH,
125 deps_revision=None): 125 deps_revision=None):
126 bot = '%s_perf_bisect' % name.replace('', '').replace('-', '_') 126 bot = '%s_perf_bisect' % name.replace('', '').replace('-', '_')
127 command, options = self._SetupTrybotCommand( 127 command, options = self._SetupTrybotCommand(
128 {bot: 'stuff'}, name, repo_path=repo_path, deps_revision=deps_revision) 128 {bot: 'stuff'}, name, repo_path=repo_path, deps_revision=deps_revision)
129 extra_benchmark_args = extra_benchmark_args or [] 129 extra_benchmark_args = extra_benchmark_args or []
130 arguments = [options.benchmark_name] + extra_benchmark_args 130 arguments = [options.benchmark_name] + extra_benchmark_args
131 cfg = command._GetPerfConfig(platform, arguments) 131 cfg = command._GetPerfConfig(platform, arguments, None)
132 132
133 return cfg, command 133 return cfg, command
134 134
135 def _ExpectedGitTryTestArgs(self, test_name, browser, target_arch='ia32'): 135 def _ExpectedGitTryTestArgs(self, test_name, browser, target_arch='ia32'):
136 return ('perf_try_config={' 136 return ('perf_try_config={'
137 '"repeat_count": "1", "command": "src/tools/perf/run_benchmark ' 137 '"repeat_count": "1", "command": "src/tools/perf/run_benchmark '
138 '--browser=%s %s --verbose", "max_time_minutes": "120", ' 138 '--browser=%s %s --verbose", "max_time_minutes": "120", '
139 '"target_arch": "%s", "truncate_percent": "0"}' % ( 139 '"target_arch": "%s", "truncate_percent": "0"}' % (
140 browser, test_name, target_arch)) 140 browser, test_name, target_arch))
141 141
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 def testRunTryJobSuccess(self): 522 def testRunTryJobSuccess(self):
523 test_args = self._ExpectedGitTryTestArgs('sunspider', 'release') 523 test_args = self._ExpectedGitTryTestArgs('sunspider', 'release')
524 command, options = self._SetupTrybotCommand( 524 command, options = self._SetupTrybotCommand(
525 {'linux_perf_bisect': 'stuff'}, 'linux', repo_path='path_to_repo/src') 525 {'linux_perf_bisect': 'stuff'}, 'linux', repo_path='path_to_repo/src')
526 arguments = [options.benchmark_name] + [] 526 arguments = [options.benchmark_name] + []
527 self._ExpectProcesses(( 527 self._ExpectProcesses((
528 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', 528 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf',
529 '-p', test_args, 529 '-p', test_args,
530 '-b', 530 '-b',
531 'linux_perf_bisect'], (0, '', None)),)) 531 'linux_perf_bisect'], (0, '', None)),))
532 command._RunTryJob('linux', arguments, None) 532 command._RunTryJob('linux', arguments, None, None)
533 self.assertEquals('Perf Try job sent to rietveld for linux platform.', 533 self.assertEquals('Perf Try job sent to rietveld for linux platform.',
534 sys.stdout.getvalue().strip()) 534 sys.stdout.getvalue().strip())
535 535
536 def testNoUpstream(self): 536 def testNoUpstream(self):
537 command, _ = self._SetupTrybotCommand({'linux_perf_bisect': 'stuff'}, 537 command, _ = self._SetupTrybotCommand({'linux_perf_bisect': 'stuff'},
538 'linux') 538 'linux')
539 self._ExpectProcesses(( 539 self._ExpectProcesses((
540 (['git', 'config', 'branch.br.remote'], (0, '.', None)), 540 (['git', 'config', 'branch.br.remote'], (0, '.', None)),
541 (['git', 'rev-parse', '--abbrev-ref', 'br@{upstream}'], 541 (['git', 'rev-parse', '--abbrev-ref', 'br@{upstream}'],
542 (128, 'None', None,)), 542 (128, 'None', None,)),
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 @benchmark.Enabled('win', 'mac') 873 @benchmark.Enabled('win', 'mac')
874 class FooBenchmark(benchmark.Benchmark): 874 class FooBenchmark(benchmark.Benchmark):
875 pass 875 pass
876 self.assertFalse(self.IsBenchmarkDisabled(FooBenchmark, 'all')) 876 self.assertFalse(self.IsBenchmarkDisabled(FooBenchmark, 'all'))
877 self.assertFalse(self.IsBenchmarkDisabled(FooBenchmark, 'all-mac')) 877 self.assertFalse(self.IsBenchmarkDisabled(FooBenchmark, 'all-mac'))
878 self.assertFalse(self.IsBenchmarkDisabled(FooBenchmark, 'winx64ati')) 878 self.assertFalse(self.IsBenchmarkDisabled(FooBenchmark, 'winx64ati'))
879 879
880 self.assertTrue(self.IsBenchmarkDisabled(FooBenchmark, 'android-s5')) 880 self.assertTrue(self.IsBenchmarkDisabled(FooBenchmark, 'android-s5'))
881 self.assertTrue(self.IsBenchmarkDisabled(FooBenchmark, 'linux')) 881 self.assertTrue(self.IsBenchmarkDisabled(FooBenchmark, 'linux'))
882 self.assertTrue(self.IsBenchmarkDisabled(FooBenchmark, 'all-linux')) 882 self.assertTrue(self.IsBenchmarkDisabled(FooBenchmark, 'all-linux'))
OLDNEW
« no previous file with comments | « tools/perf/core/trybot_command.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698