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

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: Improve readability. 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
« no previous file with comments | « appengine/findit/common/http_client_appengine.py ('k') | appengine/findit/common/test/dependency_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3bf4c4bf1ac9736b6866301c6326c2611b40f788 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')
+ self.assertEqual(expected_deps_rolls,
+ [roll.ToDict() for roll in deps_rolls])
« no previous file with comments | « appengine/findit/common/http_client_appengine.py ('k') | appengine/findit/common/test/dependency_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698