OLD | NEW |
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 """Client tool to trigger tasks or retrieve results from a Swarming server.""" | 6 """Client tool to trigger tasks or retrieve results from a Swarming server.""" |
7 | 7 |
8 __version__ = '0.1' | 8 __version__ = '0.1' |
9 | 9 |
10 import hashlib | 10 import hashlib |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 145 |
146 def to_json(self): | 146 def to_json(self): |
147 """Exports the current configuration into a swarm-readable manifest file. | 147 """Exports the current configuration into a swarm-readable manifest file. |
148 | 148 |
149 This function doesn't mutate the object. | 149 This function doesn't mutate the object. |
150 """ | 150 """ |
151 test_case = { | 151 test_case = { |
152 'test_case_name': self._test_name, | 152 'test_case_name': self._test_name, |
153 'data': [], | 153 'data': [], |
154 'tests': self._tasks, | 154 'tests': self._tasks, |
| 155 # TODO: Let the encoding get set from the command line. |
| 156 'encoding': 'UTF-8', |
155 'env_vars': {}, | 157 'env_vars': {}, |
156 'configurations': [ | 158 'configurations': [ |
157 { | 159 { |
158 'min_instances': self._shards, | 160 'min_instances': self._shards, |
159 'config_name': self._target_platform, | 161 'config_name': self._target_platform, |
160 'priority': self.priority, | 162 'priority': self.priority, |
161 'dimensions': { | 163 'dimensions': { |
162 'os': self._target_platform, | 164 'os': self._target_platform, |
163 }, | 165 }, |
164 }, | 166 }, |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 sys.stderr.write(str(e)) | 662 sys.stderr.write(str(e)) |
661 sys.stderr.write('\n') | 663 sys.stderr.write('\n') |
662 return 1 | 664 return 1 |
663 | 665 |
664 | 666 |
665 if __name__ == '__main__': | 667 if __name__ == '__main__': |
666 fix_encoding.fix_encoding() | 668 fix_encoding.fix_encoding() |
667 tools.disable_buffering() | 669 tools.disable_buffering() |
668 colorama.init() | 670 colorama.init() |
669 sys.exit(main(sys.argv[1:])) | 671 sys.exit(main(sys.argv[1:])) |
OLD | NEW |