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

Side by Side Diff: appengine/cr-buildbucket/swarming/test/swarming_test.py

Issue 2106633002: swarmbucket: non-string properties (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: remove 9999 Created 4 years, 5 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
OLDNEW
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
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 )
61 self.mock( 62 self.mock(
62 config, 'get_bucket_async', lambda name: futuristic(self.bucket_cfg)) 63 config, 'get_bucket_async', lambda name: futuristic(self.bucket_cfg))
63 64
64 task_template = { 65 task_template = {
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 'extra_args': [ 240 'extra_args': [
240 'cook', 241 'cook',
241 '-repository', 'https://example.com/repo', 242 '-repository', 'https://example.com/repo',
242 '-revision', 'badcoffee', 243 '-revision', 'badcoffee',
243 '-recipe', 'recipe', 244 '-recipe', 'recipe',
244 '-properties', json.dumps({ 245 '-properties', json.dumps({
245 'a': 'b', 246 'a': 'b',
246 'blamelist': ['bob@example.com'], 247 'blamelist': ['bob@example.com'],
247 'buildername': 'builder', 248 'buildername': 'builder',
248 'predefined-property': 'x', 249 'predefined-property': 'x',
250 'predefined-property-bool': True,
249 'repository': 'https://chromium.googlesource.com/chromium/src', 251 'repository': 'https://chromium.googlesource.com/chromium/src',
250 }, sort_keys=True) 252 }, sort_keys=True)
251 ], 253 ],
252 'dimensions': sorted([ 254 'dimensions': sorted([
253 {'key': 'cores', 'value': '8'}, 255 {'key': 'cores', 'value': '8'},
254 {'key': 'os', 'value': 'Linux'}, 256 {'key': 'os', 'value': 'Linux'},
255 {'key': 'pool', 'value': 'Chrome'}, 257 {'key': 'pool', 'value': 'Chrome'},
256 ]), 258 ]),
257 }, 259 },
258 'pubsub_topic': 'projects/testbed-test/topics/swarming', 260 'pubsub_topic': 'projects/testbed-test/topics/swarming',
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 self.assertEqual(build.status, model.BuildStatus.COMPLETED) 612 self.assertEqual(build.status, model.BuildStatus.COMPLETED)
611 self.assertEqual(build.result, model.BuildResult.FAILURE) 613 self.assertEqual(build.result, model.BuildResult.FAILURE)
612 self.assertEqual(build.failure_reason, model.FailureReason.INFRA_FAILURE) 614 self.assertEqual(build.failure_reason, model.FailureReason.INFRA_FAILURE)
613 self.assertIsNotNone(build.result_details) 615 self.assertIsNotNone(build.result_details)
614 self.assertIsNone(build.lease_key) 616 self.assertIsNone(build.lease_key)
615 self.assertIsNotNone(build.complete_time) 617 self.assertIsNotNone(build.complete_time)
616 618
617 619
618 def b64json(data): 620 def b64json(data):
619 return base64.b64encode(json.dumps(data)) 621 return base64.b64encode(json.dumps(data))
OLDNEW
« no previous file with comments | « appengine/cr-buildbucket/swarming/swarmingcfg.py ('k') | appengine/cr-buildbucket/swarming/test/swarmingcfg_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698