OLD | NEW |
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 # Copyright (C) 2008 Evan Martin <martine@danga.com> | 6 # Copyright (C) 2008 Evan Martin <martine@danga.com> |
7 | 7 |
8 """A git-command for integrating reviews on Rietveld.""" | 8 """A git-command for integrating reviews on Rietveld.""" |
9 | 9 |
10 import json | 10 import json |
(...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1584 parser.error('Specify one bot per --bot flag') | 1584 parser.error('Specify one bot per --bot flag') |
1585 else: | 1585 else: |
1586 builders_and_tests.setdefault(bot, []).append('defaulttests') | 1586 builders_and_tests.setdefault(bot, []).append('defaulttests') |
1587 | 1587 |
1588 if options.testfilter: | 1588 if options.testfilter: |
1589 forced_tests = sum((t.split(',') for t in options.testfilter), []) | 1589 forced_tests = sum((t.split(',') for t in options.testfilter), []) |
1590 builders_and_tests = dict( | 1590 builders_and_tests = dict( |
1591 (b, forced_tests) for b, t in builders_and_tests.iteritems() | 1591 (b, forced_tests) for b, t in builders_and_tests.iteritems() |
1592 if t != ['compile']) | 1592 if t != ['compile']) |
1593 | 1593 |
| 1594 if any('triggered' in b for b in builders_and_tests): |
| 1595 print >> sys.stderr, ( |
| 1596 'ERROR You are trying to send a job to a triggered bot. This type of' |
| 1597 ' bot requires an\ninitial job from a parent (usually a builder). ' |
| 1598 'Instead send your job to the parent.\n' |
| 1599 'Bot list: %s' % builders_and_tests) |
| 1600 return 1 |
| 1601 |
1594 patchset = cl.GetPatchset() | 1602 patchset = cl.GetPatchset() |
1595 if not cl.GetPatchset(): | 1603 if not cl.GetPatchset(): |
1596 patchset = cl.GetMostRecentPatchset(cl.GetIssue()) | 1604 patchset = cl.GetMostRecentPatchset(cl.GetIssue()) |
1597 | 1605 |
1598 cl.RpcServer().trigger_try_jobs( | 1606 cl.RpcServer().trigger_try_jobs( |
1599 cl.GetIssue(), patchset, options.name, options.clobber, options.revision, | 1607 cl.GetIssue(), patchset, options.name, options.clobber, options.revision, |
1600 builders_and_tests) | 1608 builders_and_tests) |
1601 print('Tried jobs on:') | 1609 print('Tried jobs on:') |
1602 length = max(len(builder) for builder in builders_and_tests) | 1610 length = max(len(builder) for builder in builders_and_tests) |
1603 for builder in sorted(builders_and_tests): | 1611 for builder in sorted(builders_and_tests): |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1708 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 1716 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
1709 | 1717 |
1710 # Not a known command. Default to help. | 1718 # Not a known command. Default to help. |
1711 GenUsage(parser, 'help') | 1719 GenUsage(parser, 'help') |
1712 return CMDhelp(parser, argv) | 1720 return CMDhelp(parser, argv) |
1713 | 1721 |
1714 | 1722 |
1715 if __name__ == '__main__': | 1723 if __name__ == '__main__': |
1716 fix_encoding.fix_encoding() | 1724 fix_encoding.fix_encoding() |
1717 sys.exit(main(sys.argv[1:])) | 1725 sys.exit(main(sys.argv[1:])) |
OLD | NEW |