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

Side by Side Diff: scripts/slave/unittests/gatekeeper_ng_test.py

Issue 141073009: Add forgive_all to enable experimental builders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Correct typo. Created 6 years, 11 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 | « scripts/slave/gatekeeper_ng.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 2013 The Chromium Authors. All rights reserved. 2 # Copyright 2013 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 """Unit tests for gatekeeper_ng.py. 6 """Unit tests for gatekeeper_ng.py.
7 7
8 This is a basic check that gatekeeper_ng.py can properly interpret builds and 8 This is a basic check that gatekeeper_ng.py can properly interpret builds and
9 close the tree. 9 close the tree.
10 10
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 853
854 self.masters[0].builders[0].builds[0].steps[1].results = [2, None] 854 self.masters[0].builders[0].builds[0].steps[1].results = [2, None]
855 self.add_gatekeeper_section(self.masters[0].url, 855 self.add_gatekeeper_section(self.masters[0].url,
856 self.masters[0].builders[0].name, 856 self.masters[0].builders[0].name,
857 {'forgiving_steps': ['step1']}) 857 {'forgiving_steps': ['step1']})
858 urls = self.call_gatekeeper() 858 urls = self.call_gatekeeper()
859 859
860 self.assertNotIn(self.mailer_url, urls) 860 self.assertNotIn(self.mailer_url, urls)
861 self.assertIn(self.status_url, urls) 861 self.assertIn(self.status_url, urls)
862 862
863 def testForgiveAllSteps(self):
864 """Test that setting forgive_all prevents emailing the blamelist."""
865 sys.argv.extend([m.url for m in self.masters])
866 sys.argv.extend(['--skip-build-db-update',
867 '--json', self.gatekeeper_file,
868 '--email-app-secret-file=%s' % self.email_secret_file,
869 '--set-status', '--password-file', self.status_secret_file
870 ])
871
872 self.masters[0].builders[0].builds[0].steps[1].results = [2, None]
873 self.add_gatekeeper_section(self.masters[0].url,
874 self.masters[0].builders[0].name,
875 {'closing_steps': ['step1'],
876 'forgive_all': 'true'})
877 urls = self.call_gatekeeper()
878
879 self.assertNotIn(self.mailer_url, urls)
880 self.assertIn(self.status_url, urls)
863 881
864 #### Multiple failures. 882 #### Multiple failures.
865 883
866 def testSequentialFailures(self): 884 def testSequentialFailures(self):
867 """Test that the status app is only hit once if many failures are seen.""" 885 """Test that the status app is only hit once if many failures are seen."""
868 sys.argv.extend([m.url for m in self.masters]) 886 sys.argv.extend([m.url for m in self.masters])
869 sys.argv.extend(['--skip-build-db-update', 887 sys.argv.extend(['--skip-build-db-update',
870 '--json', self.gatekeeper_file, 888 '--json', self.gatekeeper_file,
871 '--email-app-secret-file=%s' % self.email_secret_file, 889 '--email-app-secret-file=%s' % self.email_secret_file,
872 '--set-status', '--password-file', self.status_secret_file 890 '--set-status', '--password-file', self.status_secret_file
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
1448 def testCheckedInConfigIsValid(self): 1466 def testCheckedInConfigIsValid(self):
1449 sys.argv.extend(['--verify', 1467 sys.argv.extend(['--verify',
1450 '--json', 1468 '--json',
1451 os.path.join(SCRIPT_DIR, os.pardir, 'gatekeeper.json')]) 1469 os.path.join(SCRIPT_DIR, os.pardir, 'gatekeeper.json')])
1452 self.call_gatekeeper() 1470 self.call_gatekeeper()
1453 1471
1454 1472
1455 if __name__ == '__main__': 1473 if __name__ == '__main__':
1456 with utils.print_coverage(include=[__file__]): 1474 with utils.print_coverage(include=[__file__]):
1457 unittest.main() 1475 unittest.main()
OLDNEW
« no previous file with comments | « scripts/slave/gatekeeper_ng.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698