Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 | 4 |
| 5 import base64 | 5 import base64 |
| 6 import contextlib | 6 import contextlib |
| 7 import datetime | 7 import datetime |
| 8 import json | 8 import json |
| 9 | 9 |
| 10 from components import auth | 10 from components import auth |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 repository='https://example.com/repo', | 45 repository='https://example.com/repo', |
| 46 name='recipe', | 46 name='recipe', |
| 47 ), | 47 ), |
| 48 builders=[ | 48 builders=[ |
| 49 project_config_pb2.Swarming.Builder( | 49 project_config_pb2.Swarming.Builder( |
| 50 name='builder', | 50 name='builder', |
| 51 swarming_tags=['buildertag:yes'], | 51 swarming_tags=['buildertag:yes'], |
| 52 dimensions=['os:Linux', 'pool:Chrome'], | 52 dimensions=['os:Linux', 'pool:Chrome'], |
| 53 recipe=project_config_pb2.Swarming.Recipe( | 53 recipe=project_config_pb2.Swarming.Recipe( |
| 54 properties=['predefined-property:x'], | 54 properties=['predefined-property:x'], |
| 55 properties_j=['predefined-property-bool:true'], | |
| 55 ), | 56 ), |
| 56 priority=108, | 57 priority=108, |
| 57 ), | 58 ), |
| 58 ], | 59 ], |
| 59 ), | 60 ), |
| 60 ) | 61 ) |
| 62 self.maxDiff = 9999 | |
|
Vadim Sh.
2016/06/28 00:10:35
you can also use None (means "unlimited")
nodir
2016/06/28 00:42:38
i forgot to remove this
| |
| 61 self.mock( | 63 self.mock( |
| 62 config, 'get_bucket_async', lambda name: futuristic(self.bucket_cfg)) | 64 config, 'get_bucket_async', lambda name: futuristic(self.bucket_cfg)) |
| 63 | 65 |
| 64 task_template = { | 66 task_template = { |
| 65 'name': 'buildbucket-$bucket-$builder', | 67 'name': 'buildbucket-$bucket-$builder', |
| 66 'priority': '100', | 68 'priority': '100', |
| 67 'expiration_secs': '3600', | 69 'expiration_secs': '3600', |
| 68 'properties': { | 70 'properties': { |
| 69 'execution_timeout_secs': '3600', | 71 'execution_timeout_secs': '3600', |
| 70 'inputs_ref': { | 72 'inputs_ref': { |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 239 'extra_args': [ | 241 'extra_args': [ |
| 240 'cook', | 242 'cook', |
| 241 '-repository', 'https://example.com/repo', | 243 '-repository', 'https://example.com/repo', |
| 242 '-revision', 'badcoffee', | 244 '-revision', 'badcoffee', |
| 243 '-recipe', 'recipe', | 245 '-recipe', 'recipe', |
| 244 '-properties', json.dumps({ | 246 '-properties', json.dumps({ |
| 245 'a': 'b', | 247 'a': 'b', |
| 246 'blamelist': ['bob@example.com'], | 248 'blamelist': ['bob@example.com'], |
| 247 'buildername': 'builder', | 249 'buildername': 'builder', |
| 248 'predefined-property': 'x', | 250 'predefined-property': 'x', |
| 251 'predefined-property-bool': True, | |
| 249 'repository': 'https://chromium.googlesource.com/chromium/src', | 252 'repository': 'https://chromium.googlesource.com/chromium/src', |
| 250 }, sort_keys=True) | 253 }, sort_keys=True) |
| 251 ], | 254 ], |
| 252 'dimensions': sorted([ | 255 'dimensions': sorted([ |
| 253 {'key': 'cores', 'value': '8'}, | 256 {'key': 'cores', 'value': '8'}, |
| 254 {'key': 'os', 'value': 'Linux'}, | 257 {'key': 'os', 'value': 'Linux'}, |
| 255 {'key': 'pool', 'value': 'Chrome'}, | 258 {'key': 'pool', 'value': 'Chrome'}, |
| 256 ]), | 259 ]), |
| 257 }, | 260 }, |
| 258 'pubsub_topic': 'projects/testbed-test/topics/swarming', | 261 'pubsub_topic': 'projects/testbed-test/topics/swarming', |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 610 self.assertEqual(build.status, model.BuildStatus.COMPLETED) | 613 self.assertEqual(build.status, model.BuildStatus.COMPLETED) |
| 611 self.assertEqual(build.result, model.BuildResult.FAILURE) | 614 self.assertEqual(build.result, model.BuildResult.FAILURE) |
| 612 self.assertEqual(build.failure_reason, model.FailureReason.INFRA_FAILURE) | 615 self.assertEqual(build.failure_reason, model.FailureReason.INFRA_FAILURE) |
| 613 self.assertIsNotNone(build.result_details) | 616 self.assertIsNotNone(build.result_details) |
| 614 self.assertIsNone(build.lease_key) | 617 self.assertIsNone(build.lease_key) |
| 615 self.assertIsNotNone(build.complete_time) | 618 self.assertIsNotNone(build.complete_time) |
| 616 | 619 |
| 617 | 620 |
| 618 def b64json(data): | 621 def b64json(data): |
| 619 return base64.b64encode(json.dumps(data)) | 622 return base64.b64encode(json.dumps(data)) |
| OLD | NEW |