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

Side by Side Diff: appengine/swarming/server/task_result_test.py

Issue 2043853002: Complete CIPD integration (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@run-isolated-cipd
Patch Set: rebased and nit Created 4 years, 6 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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The LUCI Authors. All rights reserved. 2 # Copyright 2014 The LUCI Authors. All rights reserved.
3 # Use of this source code is governed under the Apache License, Version 2.0 3 # Use of this source code is governed under the Apache License, Version 2.0
4 # that can be found in the LICENSE file. 4 # that can be found in the LICENSE file.
5 5
6 import datetime 6 import datetime
7 import logging 7 import logging
8 import os 8 import os
9 import random 9 import random
10 import sys 10 import sys
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 'items_cold': 'foo', 363 'items_cold': 'foo',
364 'items_hot': 'bar', 364 'items_hot': 'bar',
365 }, 365 },
366 'isolated_upload': { 366 'isolated_upload': {
367 'duration': 0.01, 367 'duration': 0.01,
368 'initial_number_items': None, 368 'initial_number_items': None,
369 'initial_size': None, 369 'initial_size': None,
370 'items_cold': 'foo', 370 'items_cold': 'foo',
371 'items_hot': None, 371 'items_hot': None,
372 }, 372 },
373 'package_installation': {
374 'duration': None,
375 'initial_number_items': None,
376 'initial_size': None,
377 'items_cold': None,
378 'items_hot': None,
379 },
373 } 380 }
374 self.assertEqual(expected, result_summary.performance_stats.to_dict()) 381 self.assertEqual(expected, result_summary.performance_stats.to_dict())
375 self.assertEqual('foo', result_summary.get_output()) 382 self.assertEqual('foo', result_summary.get_output())
376 self.assertEqual( 383 self.assertEqual(
377 datetime.timedelta(seconds=2), 384 datetime.timedelta(seconds=2),
378 result_summary.duration_as_seen_by_server) 385 result_summary.duration_as_seen_by_server)
379 self.assertEqual( 386 self.assertEqual(
380 datetime.timedelta(seconds=0.1), 387 datetime.timedelta(seconds=0.1),
381 result_summary.duration_now(utils.utcnow())) 388 result_summary.duration_now(utils.utcnow()))
382 self.assertEqual( 389 self.assertEqual(
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 task_result.TaskOutput.CHUNK_SIZE * '\x00' + 'Baz\x00Bar\x00FooWow', 682 task_result.TaskOutput.CHUNK_SIZE * '\x00' + 'Baz\x00Bar\x00FooWow',
676 self.run_result.get_output()) 683 self.run_result.get_output())
677 self.assertTaskOutputChunk( 684 self.assertTaskOutputChunk(
678 [{'chunk': 'Baz\x00Bar\x00FooWow', 'gaps': [3, 4, 7, 8]}]) 685 [{'chunk': 'Baz\x00Bar\x00FooWow', 'gaps': [3, 4, 7, 8]}])
679 686
680 687
681 if __name__ == '__main__': 688 if __name__ == '__main__':
682 if '-v' in sys.argv: 689 if '-v' in sys.argv:
683 unittest.TestCase.maxDiff = None 690 unittest.TestCase.maxDiff = None
684 unittest.main() 691 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698