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

Unified Diff: appengine/findit/common/test/chromium_deps_test.py

Issue 1154593005: [Findit] Add a sub-pipeline to analyze failures caused by DEPS rolls. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Fix url to changes in DEPS roll. Created 5 years, 7 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
Index: appengine/findit/common/test/chromium_deps_test.py
diff --git a/appengine/findit/common/test/chromium_deps_test.py b/appengine/findit/common/test/chromium_deps_test.py
index 178945e8ec4cff9cb1487be0c338b3221d15a4bd..8287c42fa84bb08afec05b775e90e917ee754e06 100644
--- a/appengine/findit/common/test/chromium_deps_test.py
+++ b/appengine/findit/common/test/chromium_deps_test.py
@@ -107,3 +107,42 @@ class ChromiumDEPSTest(testing.AppengineTestCase):
dependency_dict = chromium_deps.GetChromeDependency(
src_revision, os_platform)
self.assertEqual(expected_dependency_dict, dependency_dict)
+
+ def testGetChromiumDEPSRolls(self):
+ def MockGetChromeDependency(revision, os_platform):
+ self.assertEqual('unix', os_platform)
+ if revision == 'rev2':
+ return {
+ 'src/': Dependency('src/', 'https://url_src', 'rev2', 'DEPS'),
+ 'src/dep1': Dependency('src/dep1', 'https://url_dep1', '9', 'DEPS'),
+ 'src/dep2': Dependency('src/dep2', 'https://url_dep2', '5', 'DEPS'),
+ 'src/dep3': Dependency('src/dep3', 'https://url_dep3', '1', 'DEPS'),
+ }
+ else:
+ self.assertEqual('rev1', revision)
+ return {
+ 'src/': Dependency('src/', 'https://url_src', 'rev1', 'DEPS'),
+ 'src/dep1': Dependency('src/dep1', 'https://url_dep1', '7', 'DEPS'),
+ 'src/dep2': Dependency('src/dep2', 'https://url_dep2', '5', 'DEPS'),
+ }
+
+ self.mock(chromium_deps, 'GetChromeDependency', MockGetChromeDependency)
+
+ expected_deps_rolls = [
+ {
+ 'path': 'src/dep1',
+ 'repo_url': 'https://url_dep1',
+ 'old_revision': '7',
+ 'new_revision': '9',
+ },
+ {
+ 'path': 'src/dep3',
+ 'repo_url': 'https://url_dep3',
+ 'old_revision': None,
+ 'new_revision': '1',
+ },
+ ]
+
+ deps_rolls = chromium_deps.GetChromiumDEPSRolls('rev1', 'rev2', 'unix')
+ for index, roll in enumerate(deps_rolls):
+ self.assertEqual(expected_deps_rolls[index], roll.ToDict())
qyearsley 2015/05/29 23:14:33 Could these three lines also be written as the fol
stgao 2015/05/30 00:21:05 Done. Was thinking of this approach too. Although

Powered by Google App Engine
This is Rietveld 408576698