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

Unified Diff: tests/fake_repos.py

Issue 2265002: Reapply 48271 with fix (again) (Closed)
Patch Set: Another fix + more smoke tests Created 10 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 | « gclient.py ('k') | tests/gclient_smoketest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/fake_repos.py
diff --git a/tests/fake_repos.py b/tests/fake_repos.py
index 852f995523caa25524763d502e57622816e40840..e55b776b2a472a2051cf277112e13157085d5503 100755
--- a/tests/fake_repos.py
+++ b/tests/fake_repos.py
@@ -205,14 +205,19 @@ class FakeRepos(object):
# - versioned and unversioned reference
# - relative and full reference
# - deps_os
- # TODO(maruel):
# - var
# - hooks
+ # TODO(maruel):
# - File
+ # - $matching_files
+ # - use_relative_paths
self._commit_svn(file_system(1, """
+vars = {
+ 'DummyVariable': 'third_party',
+}
deps = {
'src/other': 'svn://%(host)s/svn/trunk/other',
- 'src/third_party/fpp': '/trunk/third_party/foo',
+ 'src/third_party/fpp': '/trunk/' + Var('DummyVariable') + '/foo',
}
deps_os = {
'mac': {
@@ -225,6 +230,21 @@ deps = {
'src/other': 'svn://%(host)s/svn/trunk/other',
'src/third_party/foo': '/trunk/third_party/foo@1',
}
+# I think this is wrong to have the hooks run from the base of the gclient
+# checkout. It's maybe a bit too late to change that behavior.
+hooks = [
+ {
+ 'pattern': '.',
+ 'action': ['python', '-c',
+ 'open(\\'src/hooked1\\', \\'w\\').write(\\'hooked1\\')'],
+ },
+ {
+ # Should not be run.
+ 'pattern': 'nonexistent',
+ 'action': ['python', '-c',
+ 'open(\\'src/hooked2\\', \\'w\\').write(\\'hooked2\\')'],
+ },
+]
""" % { 'host': '127.0.0.1' }))
def setUpGIT(self):
@@ -241,15 +261,20 @@ deps = {
# - versioned and unversioned reference
# - relative and full reference
# - deps_os
- # TODO(maruel):
# - var
# - hooks
+ # TODO(maruel):
# - File
+ # - $matching_files
+ # - use_relative_paths
self._commit_git('repo_1', {
'DEPS': """
+vars = {
+ 'DummyVariable': 'repo',
+}
deps = {
'src/repo2': 'git://%(host)s/git/repo_2',
- 'src/repo2/repo3': '/repo_3',
+ 'src/repo2/repo3': '/' + Var('DummyVariable') + '_3',
}
deps_os = {
'mac': {
@@ -289,7 +314,24 @@ deps = {
'src/repo2': 'git://%(host)s/git/repo_2@%(hash)s',
'src/repo2/repo_renamed': '/repo_3',
}
-""" % { 'host': '127.0.0.1', 'hash': self.git_hashes['repo_2'][0][0] },
+# I think this is wrong to have the hooks run from the base of the gclient
+# checkout. It's maybe a bit too late to change that behavior.
+hooks = [
+ {
+ 'pattern': '.',
+ 'action': ['python', '-c',
+ 'open(\\'src/hooked1\\', \\'w\\').write(\\'hooked1\\')'],
+ },
+ {
+ # Should not be run.
+ 'pattern': 'nonexistent',
+ 'action': ['python', '-c',
+ 'open(\\'src/hooked2\\', \\'w\\').write(\\'hooked2\\')'],
+ },
+]
+""" % {
+ # TODO(maruel): http://crosbug.com/3591 We need to strip the hash.. duh.
+ 'host': '127.0.0.1', 'hash': self.git_hashes['repo_2'][0][0][:7] },
'origin': "git/repo_1@2\n"
})
« no previous file with comments | « gclient.py ('k') | tests/gclient_smoketest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698