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

Unified Diff: scripts/slave/unittests/annotated_run_test.py

Issue 1881123003: annotated_run: extract CipdBinary so it can be shared with kitchen_run (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: presubmit Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « scripts/slave/cipd.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/unittests/annotated_run_test.py
diff --git a/scripts/slave/unittests/annotated_run_test.py b/scripts/slave/unittests/annotated_run_test.py
index 143e3a4e20b878b46b934ec9d62810af7017b03c..8fc7c62a76f9f0648374c9e2266956c4148e0ec0 100755
--- a/scripts/slave/unittests/annotated_run_test.py
+++ b/scripts/slave/unittests/annotated_run_test.py
@@ -22,6 +22,7 @@ import mock
from common import chromium_utils
from common import env
from slave import annotated_run
+from slave import cipd
from slave import gce
from slave import infra_platform
from slave import robust_tempdir
@@ -297,14 +298,15 @@ class AnnotatedRunLogDogExecTest(_AnnotatedRunExecTestBase):
@mock.patch('os.path.isfile')
@mock.patch('slave.annotated_run._logdog_install_cipd')
@mock.patch('slave.annotated_run._get_service_account_json')
- def test_runs_directly_if_logdog_error(self, service_account, cipd, isfile):
+ def test_runs_directly_if_logdog_error(
+ self, service_account, install_cipd, isfile):
self.properties['buildername'] = 'yesbuilder'
# Test Windows builder this time.
infra_platform.get.return_value = ('win', 64)
isfile.return_value = True
- cipd.return_value = ('logdog_butler.exe', 'logdog_annotee.exe')
+ install_cipd.return_value = ('logdog_butler.exe', 'logdog_annotee.exe')
service_account.return_value = 'creds.json'
def error_for_logdog(args, **kw):
if len(args) > 0 and args[0] == 'logdog_butler.exe':
@@ -366,8 +368,8 @@ class AnnotatedRunLogDogExecTest(_AnnotatedRunExecTestBase):
annotated_run._run_command.return_value = (0, '')
pkgs = annotated_run._logdog_install_cipd(self.basedir,
- annotated_run.CipdBinary('infra/foo', 'v0', 'foo'),
- annotated_run.CipdBinary('infra/bar', 'v1', 'baz'),
+ cipd.CipdBinary(cipd.CipdPackage('infra/foo', 'v0'), 'foo'),
+ cipd.CipdBinary(cipd.CipdPackage('infra/bar', 'v1'), 'baz'),
)
self.assertEqual(pkgs, (self._bp('foo'), self._bp('baz')))
@@ -386,8 +388,8 @@ class AnnotatedRunLogDogExecTest(_AnnotatedRunExecTestBase):
self.assertRaises(annotated_run.LogDogBootstrapError,
annotated_run._logdog_install_cipd,
self.basedir,
- annotated_run.CipdBinary('infra/foo', 'v0', 'foo'),
- annotated_run.CipdBinary('infra/bar', 'v1', 'baz'),
+ cipd.CipdBinary(cipd.CipdPackage('infra/foo', 'v0'), 'foo'),
+ cipd.CipdBinary(cipd.CipdPackage('infra/bar', 'v1'), 'baz'),
)
def test_will_not_bootstrap_if_recursive(self):
« no previous file with comments | « scripts/slave/cipd.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698