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

Side by Side Diff: appengine/swarming/swarming_bot/bot_code/task_runner_test.py

Issue 2069903003: swarming: custom cipd package paths (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@cipd-win
Patch Set: fix _validate_cipd_path 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 # coding=utf-8 2 # coding=utf-8
3 # Copyright 2013 The LUCI Authors. All rights reserved. 3 # Copyright 2013 The LUCI Authors. All rights reserved.
4 # Use of this source code is governed under the Apache License, Version 2.0 4 # Use of this source code is governed under the Apache License, Version 2.0
5 # that can be found in the LICENSE file. 5 # that can be found in the LICENSE file.
6 6
7 import base64 7 import base64
8 import json 8 import json
9 import logging 9 import logging
10 import os 10 import os
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 ' \'internal_failure\': None,\n' 331 ' \'internal_failure\': None,\n'
332 ' \'outputs_ref\': {\n' 332 ' \'outputs_ref\': {\n'
333 ' \'isolated\': \'123\',\n' 333 ' \'isolated\': \'123\',\n'
334 ' \'isolatedserver\': \'http://localhost:1\',\n' 334 ' \'isolatedserver\': \'http://localhost:1\',\n'
335 ' \'namespace\': \'default-gzip\',\n' 335 ' \'namespace\': \'default-gzip\',\n'
336 ' },\n' 336 ' },\n'
337 ' }, f)\n' 337 ' }, f)\n'
338 'sys.stdout.write(\'hi\\n\')') 338 'sys.stdout.write(\'hi\\n\')')
339 self.mock( 339 self.mock(
340 task_runner, 'get_isolated_cmd', 340 task_runner, 'get_isolated_cmd',
341 lambda _work_dir, _details, isolated_result, min_free_space, bot_file: 341 lambda _work_dir, _details, isolated_result, bot_file, pkg_list,
342 min_free_space:
342 [sys.executable, '-u', '-c', SCRIPT_ISOLATED, isolated_result]) 343 [sys.executable, '-u', '-c', SCRIPT_ISOLATED, isolated_result])
343 expected = { 344 expected = {
344 u'exit_code': 0, 345 u'exit_code': 0,
345 u'hard_timeout': False, 346 u'hard_timeout': False,
346 u'io_timeout': False, 347 u'io_timeout': False,
347 u'must_signal_internal_failure': None, 348 u'must_signal_internal_failure': None,
348 u'version': task_runner.OUT_VERSION, 349 u'version': task_runner.OUT_VERSION,
349 } 350 }
350 self.assertEqual(expected, self._run_command(task_details)) 351 self.assertEqual(expected, self._run_command(task_details))
351 352
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 fix_encoding.fix_encoding() 1147 fix_encoding.fix_encoding()
1147 if '-v' in sys.argv: 1148 if '-v' in sys.argv:
1148 unittest.TestCase.maxDiff = None 1149 unittest.TestCase.maxDiff = None
1149 logging_utils.prepare_logging(None) 1150 logging_utils.prepare_logging(None)
1150 logging_utils.set_console_level( 1151 logging_utils.set_console_level(
1151 logging.DEBUG if '-v' in sys.argv else logging.CRITICAL+1) 1152 logging.DEBUG if '-v' in sys.argv else logging.CRITICAL+1)
1152 # Fix litteral text expectation. 1153 # Fix litteral text expectation.
1153 os.environ['LANG'] = 'en_US.UTF-8' 1154 os.environ['LANG'] = 'en_US.UTF-8'
1154 os.environ['LANGUAGE'] = 'en_US.UTF-8' 1155 os.environ['LANGUAGE'] = 'en_US.UTF-8'
1155 unittest.main() 1156 unittest.main()
OLDNEW
« no previous file with comments | « appengine/swarming/swarming_bot/bot_code/task_runner.py ('k') | appengine/swarming/swarming_rpcs.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698