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

Side by Side Diff: tests/project_test.py

Issue 136643007: Revert of Reduce spam from CQ. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/commit-queue
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « tests/pending_manager_test.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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Integration tests for project.py.""" 6 """Integration tests for project.py."""
7 7
8 import logging 8 import logging
9 import os 9 import os
10 import random 10 import random
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 "[u'browser_tests']})" % issue, 428 "[u'browser_tests']})" % issue,
429 "trigger_try_jobs(%d, 1, 'CQ', False, 'HEAD', {u'mac_rel': " 429 "trigger_try_jobs(%d, 1, 'CQ', False, 'HEAD', {u'mac_rel': "
430 "[u'browser_tests']})" % issue, 430 "[u'browser_tests']})" % issue,
431 "trigger_try_jobs(%d, 1, 'CQ', False, 'HEAD', {u'win_rel': " 431 "trigger_try_jobs(%d, 1, 'CQ', False, 'HEAD', {u'win_rel': "
432 "[u'browser_tests']})" % issue, 432 "[u'browser_tests']})" % issue,
433 ] 433 ]
434 self._verify_final_state(pending_manager.queue.get(issue).verifications, 434 self._verify_final_state(pending_manager.queue.get(issue).verifications,
435 why_not, rietveld_calls) 435 why_not, rietveld_calls)
436 436
437 def test_tbr(self): 437 def test_tbr(self):
438 self.time = map(lambda x: float(x*35), range(16)) 438 self.time = map(lambda x: float(x*35), range(15))
439 self.urlrequests = [ 439 self.urlrequests = [
440 ('https://chromium-status.appspot.com/allstatus?format=json&endTime=85', 440 ('https://chromium-status.appspot.com/allstatus?format=json&endTime=85',
441 # Cheap hack here. 441 # Cheap hack here.
442 '[]'), 442 '[]'),
443 ] 443 ]
444 root_dir = os.path.join(os.getcwd(), 'root_dir') 444 root_dir = os.path.join(os.getcwd(), 'root_dir')
445 self.read_lines = [ 445 self.read_lines = [
446 [ 446 [
447 os.path.join(root_dir, '.chromium_status_pwd'), 447 os.path.join(root_dir, '.chromium_status_pwd'),
448 'chromium-status password', 448 'chromium-status password',
(...skipping 30 matching lines...) Expand all
479 pc.update_status() 479 pc.update_status()
480 pc.scan_results() 480 pc.scan_results()
481 self.assertEqual(0, len(pc.queue.iterate())) 481 self.assertEqual(0, len(pc.queue.iterate()))
482 # check_calls 482 # check_calls
483 self.context.rietveld.check_calls([ 483 self.context.rietveld.check_calls([
484 _try_comment(pc), 484 _try_comment(pc),
485 "trigger_try_jobs(31337, 1, 'CQ', False, 'HEAD', " 485 "trigger_try_jobs(31337, 1, 'CQ', False, 'HEAD', "
486 "{u'chromium_presubmit': ['presubmit']})", 486 "{u'chromium_presubmit': ['presubmit']})",
487 'close_issue(31337)', 487 'close_issue(31337)',
488 "update_description(31337, u'foo\\nTBR=')", 488 "update_description(31337, u'foo\\nTBR=')",
489 "set_flag(31337, 1, 'commit', False)",
490 "add_comment(31337, 'Change committed as 125')", 489 "add_comment(31337, 'Change committed as 125')",
491 ]) 490 ])
492 self.context.checkout.check_calls([ 491 self.context.checkout.check_calls([
493 'prepare(None)', 492 'prepare(None)',
494 'apply_patch(%r)' % self.context.rietveld.patchsets[0], 493 'apply_patch(%r)' % self.context.rietveld.patchsets[0],
495 'prepare(None)', 494 'prepare(None)',
496 'apply_patch(%r)' % self.context.rietveld.patchsets[1], 495 'apply_patch(%r)' % self.context.rietveld.patchsets[1],
497 "commit(u'foo\\nTBR=\\n\\nReview URL: http://nowhere/31337', " 496 "commit(u'foo\\nTBR=\\n\\nReview URL: http://nowhere/31337', "
498 "u'user@example.com')", 497 "u'user@example.com')",
499 ]) 498 ])
500 self.context.status.check_names(['initial', 'why not', 'why not', 499 self.context.status.check_names(['initial', 'why not', 'why not',
501 'why not', 'commit', 'abort']) 500 'why not', 'commit'])
502 501
503 502
504 503
505 if __name__ == '__main__': 504 if __name__ == '__main__':
506 logging.basicConfig( 505 logging.basicConfig(
507 level=logging.DEBUG if '-v' in sys.argv else logging.WARNING, 506 level=logging.DEBUG if '-v' in sys.argv else logging.WARNING,
508 format='%(levelname)5s %(module)15s(%(lineno)3d): %(message)s') 507 format='%(levelname)5s %(module)15s(%(lineno)3d): %(message)s')
509 unittest.main() 508 unittest.main()
OLDNEW
« no previous file with comments | « tests/pending_manager_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698