From 284e34ae2878ddd2cda671554b444db8512fa2ab Mon Sep 17 00:00:00 2001 From: Nodir Turakulov Date: Mon, 27 Mar 2017 20:20:26 +0000 Subject: [PATCH] Revert "add "generic" infra path config" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8b5b594115480a6b4c4bbe384cc7afaecd814a4b. Reason for revert: nothing wrong with this CL, but implementing a manual roll to build.git takes more than 20 min. I will reland this CL once my roll to build.git CL is ready Original change's description: > add "generic" infra path config > > It proved to be dangerous to introduce conditional logic into recipes > and recipe modules to alternate between buildbot and luci modes, namely > it touches buildbot code paths, which can be very dangerous. > > Instead, introduce "generic" default path config that configures > existing base paths from the built-in ones. > > Also remove swarmbucket path config because it is not used. > > R=​iannucci@chromium.org > BUG=660481 > > Change-Id: Ide0e1f64913fe35766b997ab5b55f01f4c63aa58 > Reviewed-on: https://chromium-review.googlesource.com/459234 > Commit-Queue: Nodir Turakulov > Reviewed-by: Robbie Iannucci > TBR=iannucci@chromium.org,nodir@chromium.org,chromium-reviews@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=660481 Change-Id: If27a537689dfe3669015bcbc7a5f07ca1f5c10af Reviewed-on: https://chromium-review.googlesource.com/461223 Reviewed-by: Nodir Turakulov Commit-Queue: Nodir Turakulov --- .../example.expected/paths_generic_linux.json | 15 --------------- .../example.expected/paths_generic_mac.json | 15 --------------- .../example.expected/paths_generic_win.json | 15 --------------- .../gclient/example.expected/basic.json | 2 +- .../gclient/example.expected/revision.json | 2 +- .../gclient/example.expected/tryserver.json | 2 +- .../example.expected/git-cache-checkout.json | 4 ++-- recipes/recipe_modules/infra_paths/api.py | 19 +++++++++++++++---- .../infra_paths/example.expected/basic.json | 3 ++- .../paths_buildbot_linux.json | 3 ++- .../example.expected/paths_buildbot_mac.json | 3 ++- .../example.expected/paths_buildbot_win.json | 3 ++- .../example.expected/paths_generic_linux.json | 15 --------------- .../example.expected/paths_generic_mac.json | 15 --------------- .../example.expected/paths_generic_win.json | 15 --------------- .../example.expected/paths_kitchen_linux.json | 3 ++- .../example.expected/paths_kitchen_mac.json | 3 ++- .../example.expected/paths_kitchen_win.json | 3 ++- .../paths_swarmbucket_linux.json | 16 ++++++++++++++++ .../paths_swarmbucket_mac.json | 16 ++++++++++++++++ .../paths_swarmbucket_win.json | 16 ++++++++++++++++ recipes/recipe_modules/infra_paths/example.py | 5 +++-- .../recipe_modules/infra_paths/path_config.py | 8 +++----- 23 files changed, 88 insertions(+), 113 deletions(-) delete mode 100644 recipe_modules/infra_paths/example.expected/paths_generic_linux.json delete mode 100644 recipe_modules/infra_paths/example.expected/paths_generic_mac.json delete mode 100644 recipe_modules/infra_paths/example.expected/paths_generic_win.json delete mode 100644 recipes/recipe_modules/infra_paths/example.expected/paths_generic_linux.json delete mode 100644 recipes/recipe_modules/infra_paths/example.expected/paths_generic_mac.json delete mode 100644 recipes/recipe_modules/infra_paths/example.expected/paths_generic_win.json create mode 100644 recipes/recipe_modules/infra_paths/example.expected/paths_swarmbucket_linux.json create mode 100644 recipes/recipe_modules/infra_paths/example.expected/paths_swarmbucket_mac.json create mode 100644 recipes/recipe_modules/infra_paths/example.expected/paths_swarmbucket_win.json diff --git a/recipe_modules/infra_paths/example.expected/paths_generic_linux.json b/recipe_modules/infra_paths/example.expected/paths_generic_linux.json deleted file mode 100644 index b366b44fb..000000000 --- a/recipe_modules/infra_paths/example.expected/paths_generic_linux.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - { - "cmd": [], - "name": "show cache path", - "~followup_annotations": [ - "@@@STEP_LOG_LINE@result@base_paths: {'builder_cache': ('/', 'b', 'c', 'builder'), 'cache': ('/', 'b', 'c'), 'goma_cache': ('/', 'b', 'c', 'goma'), 'start_dir': ('/', 'b', 'FakeTestingCWD'), 'git_cache': ('/', 'b', 'c', 'git'), 'tmp_base': ('/',)}@@@", - "@@@STEP_LOG_END@result@@@" - ] - }, - { - "name": "$result", - "recipe_result": null, - "status_code": 0 - } -] \ No newline at end of file diff --git a/recipe_modules/infra_paths/example.expected/paths_generic_mac.json b/recipe_modules/infra_paths/example.expected/paths_generic_mac.json deleted file mode 100644 index b366b44fb..000000000 --- a/recipe_modules/infra_paths/example.expected/paths_generic_mac.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - { - "cmd": [], - "name": "show cache path", - "~followup_annotations": [ - "@@@STEP_LOG_LINE@result@base_paths: {'builder_cache': ('/', 'b', 'c', 'builder'), 'cache': ('/', 'b', 'c'), 'goma_cache': ('/', 'b', 'c', 'goma'), 'start_dir': ('/', 'b', 'FakeTestingCWD'), 'git_cache': ('/', 'b', 'c', 'git'), 'tmp_base': ('/',)}@@@", - "@@@STEP_LOG_END@result@@@" - ] - }, - { - "name": "$result", - "recipe_result": null, - "status_code": 0 - } -] \ No newline at end of file diff --git a/recipe_modules/infra_paths/example.expected/paths_generic_win.json b/recipe_modules/infra_paths/example.expected/paths_generic_win.json deleted file mode 100644 index b366b44fb..000000000 --- a/recipe_modules/infra_paths/example.expected/paths_generic_win.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - { - "cmd": [], - "name": "show cache path", - "~followup_annotations": [ - "@@@STEP_LOG_LINE@result@base_paths: {'builder_cache': ('/', 'b', 'c', 'builder'), 'cache': ('/', 'b', 'c'), 'goma_cache': ('/', 'b', 'c', 'goma'), 'start_dir': ('/', 'b', 'FakeTestingCWD'), 'git_cache': ('/', 'b', 'c', 'git'), 'tmp_base': ('/',)}@@@", - "@@@STEP_LOG_END@result@@@" - ] - }, - { - "name": "$result", - "recipe_result": null, - "status_code": 0 - } -] \ No newline at end of file diff --git a/recipes/recipe_modules/gclient/example.expected/basic.json b/recipes/recipe_modules/gclient/example.expected/basic.json index 8a2bd2f8b..5d4187915 100644 --- a/recipes/recipe_modules/gclient/example.expected/basic.json +++ b/recipes/recipe_modules/gclient/example.expected/basic.json @@ -89,7 +89,7 @@ "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "config", "--spec", - "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'Angle', 'url': 'https://chromium.googlesource.com/angle/angle.git'}]" + "cache_dir = '[CACHE]/git'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'Angle', 'url': 'https://chromium.googlesource.com/angle/angle.git'}]" ], "cwd": "[START_DIR]/src/third_party", "env": { diff --git a/recipes/recipe_modules/gclient/example.expected/revision.json b/recipes/recipe_modules/gclient/example.expected/revision.json index 06990d97d..31be88b2b 100644 --- a/recipes/recipe_modules/gclient/example.expected/revision.json +++ b/recipes/recipe_modules/gclient/example.expected/revision.json @@ -91,7 +91,7 @@ "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "config", "--spec", - "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'Angle', 'url': 'https://chromium.googlesource.com/angle/angle.git'}]" + "cache_dir = '[CACHE]/git'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'Angle', 'url': 'https://chromium.googlesource.com/angle/angle.git'}]" ], "cwd": "[START_DIR]/src/third_party", "env": { diff --git a/recipes/recipe_modules/gclient/example.expected/tryserver.json b/recipes/recipe_modules/gclient/example.expected/tryserver.json index 1dcffb99c..99cfc83a8 100644 --- a/recipes/recipe_modules/gclient/example.expected/tryserver.json +++ b/recipes/recipe_modules/gclient/example.expected/tryserver.json @@ -91,7 +91,7 @@ "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "config", "--spec", - "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'Angle', 'url': 'https://chromium.googlesource.com/angle/angle.git'}]" + "cache_dir = '[CACHE]/git'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'Angle', 'url': 'https://chromium.googlesource.com/angle/angle.git'}]" ], "cwd": "[START_DIR]/src/third_party", "env": { diff --git a/recipes/recipe_modules/git/example.expected/git-cache-checkout.json b/recipes/recipe_modules/git/example.expected/git-cache-checkout.json index e5fb9badd..7d34b2ecb 100644 --- a/recipes/recipe_modules/git/example.expected/git-cache-checkout.json +++ b/recipes/recipe_modules/git/example.expected/git-cache-checkout.json @@ -18,7 +18,7 @@ "cache", "populate", "-c", - "[GIT_CACHE]", + "[CACHE]/git", "https://chromium.googlesource.com/chromium/src.git" ], "cwd": "[START_DIR]/src", @@ -35,7 +35,7 @@ "exists", "--quiet", "--cache-dir", - "[GIT_CACHE]", + "[CACHE]/git", "https://chromium.googlesource.com/chromium/src.git" ], "cwd": "[START_DIR]/src", diff --git a/recipes/recipe_modules/infra_paths/api.py b/recipes/recipe_modules/infra_paths/api.py index 643d0e5ad..9c1db4566 100644 --- a/recipes/recipe_modules/infra_paths/api.py +++ b/recipes/recipe_modules/infra_paths/api.py @@ -9,10 +9,21 @@ class InfraPathsApi(recipe_api.RecipeApi): """infra_paths module is glue for design mistakes. It will be removed.""" def initialize(self): - path_config = self.m.properties.get('path_config', 'generic') - self.m.path.set_config('infra_' + path_config) + path_config = self.m.properties.get('path_config') + if path_config: + # TODO(phajdan.jr): remove dupes from the engine and delete infra_ prefix. + self.m.path.set_config('infra_' + path_config) @property def default_git_cache_dir(self): - """Returns the location of the default git cache directory.""" - return self.m.path['git_cache'] + """Returns the location of the default git cache directory. + + This property should be used instead of using path['git_cache'] directly. + + It returns git_cache path if it is defined (Buildbot world), otherwise + uses the more generic [CACHE]/git path (LUCI world). + """ + try: + return self.m.path['git_cache'] + except KeyError: + return self.m.path['cache'].join('git') diff --git a/recipes/recipe_modules/infra_paths/example.expected/basic.json b/recipes/recipe_modules/infra_paths/example.expected/basic.json index b366b44fb..2b403b0a5 100644 --- a/recipes/recipe_modules/infra_paths/example.expected/basic.json +++ b/recipes/recipe_modules/infra_paths/example.expected/basic.json @@ -3,7 +3,8 @@ "cmd": [], "name": "show cache path", "~followup_annotations": [ - "@@@STEP_LOG_LINE@result@base_paths: {'builder_cache': ('/', 'b', 'c', 'builder'), 'cache': ('/', 'b', 'c'), 'goma_cache': ('/', 'b', 'c', 'goma'), 'start_dir': ('/', 'b', 'FakeTestingCWD'), 'git_cache': ('/', 'b', 'c', 'git'), 'tmp_base': ('/',)}@@@", + "@@@STEP_LOG_LINE@result@[CACHE]@@@", + "@@@STEP_LOG_LINE@result@[CACHE]/git@@@", "@@@STEP_LOG_END@result@@@" ] }, diff --git a/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_linux.json b/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_linux.json index d9b7f0063..02ec764ee 100644 --- a/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_linux.json +++ b/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_linux.json @@ -3,7 +3,8 @@ "cmd": [], "name": "show cache path", "~followup_annotations": [ - "@@@STEP_LOG_LINE@result@base_paths: {'depot_tools': ('depot_tools',), 'build_internal': ('build_internal',), 'cache': ('build', 'slave', 'cache'), 'goma_cache': ('build', 'slave', 'goma_cache'), 'start_dir': ('/', 'b', 'FakeTestingCWD'), 'build': ('build',), 'git_cache': ('build', 'slave', 'cache_dir'), 'root': (), 'tmp_base': ('/',)}@@@", + "@@@STEP_LOG_LINE@result@[CACHE]@@@", + "@@@STEP_LOG_LINE@result@[GIT_CACHE]@@@", "@@@STEP_LOG_END@result@@@" ] }, diff --git a/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_mac.json b/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_mac.json index d9b7f0063..02ec764ee 100644 --- a/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_mac.json +++ b/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_mac.json @@ -3,7 +3,8 @@ "cmd": [], "name": "show cache path", "~followup_annotations": [ - "@@@STEP_LOG_LINE@result@base_paths: {'depot_tools': ('depot_tools',), 'build_internal': ('build_internal',), 'cache': ('build', 'slave', 'cache'), 'goma_cache': ('build', 'slave', 'goma_cache'), 'start_dir': ('/', 'b', 'FakeTestingCWD'), 'build': ('build',), 'git_cache': ('build', 'slave', 'cache_dir'), 'root': (), 'tmp_base': ('/',)}@@@", + "@@@STEP_LOG_LINE@result@[CACHE]@@@", + "@@@STEP_LOG_LINE@result@[GIT_CACHE]@@@", "@@@STEP_LOG_END@result@@@" ] }, diff --git a/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_win.json b/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_win.json index d9b7f0063..02ec764ee 100644 --- a/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_win.json +++ b/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_win.json @@ -3,7 +3,8 @@ "cmd": [], "name": "show cache path", "~followup_annotations": [ - "@@@STEP_LOG_LINE@result@base_paths: {'depot_tools': ('depot_tools',), 'build_internal': ('build_internal',), 'cache': ('build', 'slave', 'cache'), 'goma_cache': ('build', 'slave', 'goma_cache'), 'start_dir': ('/', 'b', 'FakeTestingCWD'), 'build': ('build',), 'git_cache': ('build', 'slave', 'cache_dir'), 'root': (), 'tmp_base': ('/',)}@@@", + "@@@STEP_LOG_LINE@result@[CACHE]@@@", + "@@@STEP_LOG_LINE@result@[GIT_CACHE]@@@", "@@@STEP_LOG_END@result@@@" ] }, diff --git a/recipes/recipe_modules/infra_paths/example.expected/paths_generic_linux.json b/recipes/recipe_modules/infra_paths/example.expected/paths_generic_linux.json deleted file mode 100644 index b366b44fb..000000000 --- a/recipes/recipe_modules/infra_paths/example.expected/paths_generic_linux.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - { - "cmd": [], - "name": "show cache path", - "~followup_annotations": [ - "@@@STEP_LOG_LINE@result@base_paths: {'builder_cache': ('/', 'b', 'c', 'builder'), 'cache': ('/', 'b', 'c'), 'goma_cache': ('/', 'b', 'c', 'goma'), 'start_dir': ('/', 'b', 'FakeTestingCWD'), 'git_cache': ('/', 'b', 'c', 'git'), 'tmp_base': ('/',)}@@@", - "@@@STEP_LOG_END@result@@@" - ] - }, - { - "name": "$result", - "recipe_result": null, - "status_code": 0 - } -] \ No newline at end of file diff --git a/recipes/recipe_modules/infra_paths/example.expected/paths_generic_mac.json b/recipes/recipe_modules/infra_paths/example.expected/paths_generic_mac.json deleted file mode 100644 index b366b44fb..000000000 --- a/recipes/recipe_modules/infra_paths/example.expected/paths_generic_mac.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - { - "cmd": [], - "name": "show cache path", - "~followup_annotations": [ - "@@@STEP_LOG_LINE@result@base_paths: {'builder_cache': ('/', 'b', 'c', 'builder'), 'cache': ('/', 'b', 'c'), 'goma_cache': ('/', 'b', 'c', 'goma'), 'start_dir': ('/', 'b', 'FakeTestingCWD'), 'git_cache': ('/', 'b', 'c', 'git'), 'tmp_base': ('/',)}@@@", - "@@@STEP_LOG_END@result@@@" - ] - }, - { - "name": "$result", - "recipe_result": null, - "status_code": 0 - } -] \ No newline at end of file diff --git a/recipes/recipe_modules/infra_paths/example.expected/paths_generic_win.json b/recipes/recipe_modules/infra_paths/example.expected/paths_generic_win.json deleted file mode 100644 index b366b44fb..000000000 --- a/recipes/recipe_modules/infra_paths/example.expected/paths_generic_win.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - { - "cmd": [], - "name": "show cache path", - "~followup_annotations": [ - "@@@STEP_LOG_LINE@result@base_paths: {'builder_cache': ('/', 'b', 'c', 'builder'), 'cache': ('/', 'b', 'c'), 'goma_cache': ('/', 'b', 'c', 'goma'), 'start_dir': ('/', 'b', 'FakeTestingCWD'), 'git_cache': ('/', 'b', 'c', 'git'), 'tmp_base': ('/',)}@@@", - "@@@STEP_LOG_END@result@@@" - ] - }, - { - "name": "$result", - "recipe_result": null, - "status_code": 0 - } -] \ No newline at end of file diff --git a/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_linux.json b/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_linux.json index 7c7a128d9..02ec764ee 100644 --- a/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_linux.json +++ b/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_linux.json @@ -3,7 +3,8 @@ "cmd": [], "name": "show cache path", "~followup_annotations": [ - "@@@STEP_LOG_LINE@result@base_paths: {'builder_cache': ('/', 'b', 'c', 'b'), 'goma_deps_cache': ('/', 'b', 'c', 'goma_deps_cache'), 'cache': ('/', 'b', 'c'), 'goma_cache': ('/', 'b', 'c', 'goma_cache'), 'start_dir': ('/', 'b', 'FakeTestingCWD'), 'git_cache': ('/', 'b', 'c', 'git_cache'), 'root': ('/', 'b', 'FakeTestingCWD'), 'tmp_base': ('/',)}@@@", + "@@@STEP_LOG_LINE@result@[CACHE]@@@", + "@@@STEP_LOG_LINE@result@[GIT_CACHE]@@@", "@@@STEP_LOG_END@result@@@" ] }, diff --git a/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_mac.json b/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_mac.json index 7c7a128d9..02ec764ee 100644 --- a/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_mac.json +++ b/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_mac.json @@ -3,7 +3,8 @@ "cmd": [], "name": "show cache path", "~followup_annotations": [ - "@@@STEP_LOG_LINE@result@base_paths: {'builder_cache': ('/', 'b', 'c', 'b'), 'goma_deps_cache': ('/', 'b', 'c', 'goma_deps_cache'), 'cache': ('/', 'b', 'c'), 'goma_cache': ('/', 'b', 'c', 'goma_cache'), 'start_dir': ('/', 'b', 'FakeTestingCWD'), 'git_cache': ('/', 'b', 'c', 'git_cache'), 'root': ('/', 'b', 'FakeTestingCWD'), 'tmp_base': ('/',)}@@@", + "@@@STEP_LOG_LINE@result@[CACHE]@@@", + "@@@STEP_LOG_LINE@result@[GIT_CACHE]@@@", "@@@STEP_LOG_END@result@@@" ] }, diff --git a/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_win.json b/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_win.json index 7c7a128d9..02ec764ee 100644 --- a/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_win.json +++ b/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_win.json @@ -3,7 +3,8 @@ "cmd": [], "name": "show cache path", "~followup_annotations": [ - "@@@STEP_LOG_LINE@result@base_paths: {'builder_cache': ('/', 'b', 'c', 'b'), 'goma_deps_cache': ('/', 'b', 'c', 'goma_deps_cache'), 'cache': ('/', 'b', 'c'), 'goma_cache': ('/', 'b', 'c', 'goma_cache'), 'start_dir': ('/', 'b', 'FakeTestingCWD'), 'git_cache': ('/', 'b', 'c', 'git_cache'), 'root': ('/', 'b', 'FakeTestingCWD'), 'tmp_base': ('/',)}@@@", + "@@@STEP_LOG_LINE@result@[CACHE]@@@", + "@@@STEP_LOG_LINE@result@[GIT_CACHE]@@@", "@@@STEP_LOG_END@result@@@" ] }, diff --git a/recipes/recipe_modules/infra_paths/example.expected/paths_swarmbucket_linux.json b/recipes/recipe_modules/infra_paths/example.expected/paths_swarmbucket_linux.json new file mode 100644 index 000000000..02ec764ee --- /dev/null +++ b/recipes/recipe_modules/infra_paths/example.expected/paths_swarmbucket_linux.json @@ -0,0 +1,16 @@ +[ + { + "cmd": [], + "name": "show cache path", + "~followup_annotations": [ + "@@@STEP_LOG_LINE@result@[CACHE]@@@", + "@@@STEP_LOG_LINE@result@[GIT_CACHE]@@@", + "@@@STEP_LOG_END@result@@@" + ] + }, + { + "name": "$result", + "recipe_result": null, + "status_code": 0 + } +] \ No newline at end of file diff --git a/recipes/recipe_modules/infra_paths/example.expected/paths_swarmbucket_mac.json b/recipes/recipe_modules/infra_paths/example.expected/paths_swarmbucket_mac.json new file mode 100644 index 000000000..02ec764ee --- /dev/null +++ b/recipes/recipe_modules/infra_paths/example.expected/paths_swarmbucket_mac.json @@ -0,0 +1,16 @@ +[ + { + "cmd": [], + "name": "show cache path", + "~followup_annotations": [ + "@@@STEP_LOG_LINE@result@[CACHE]@@@", + "@@@STEP_LOG_LINE@result@[GIT_CACHE]@@@", + "@@@STEP_LOG_END@result@@@" + ] + }, + { + "name": "$result", + "recipe_result": null, + "status_code": 0 + } +] \ No newline at end of file diff --git a/recipes/recipe_modules/infra_paths/example.expected/paths_swarmbucket_win.json b/recipes/recipe_modules/infra_paths/example.expected/paths_swarmbucket_win.json new file mode 100644 index 000000000..02ec764ee --- /dev/null +++ b/recipes/recipe_modules/infra_paths/example.expected/paths_swarmbucket_win.json @@ -0,0 +1,16 @@ +[ + { + "cmd": [], + "name": "show cache path", + "~followup_annotations": [ + "@@@STEP_LOG_LINE@result@[CACHE]@@@", + "@@@STEP_LOG_LINE@result@[GIT_CACHE]@@@", + "@@@STEP_LOG_END@result@@@" + ] + }, + { + "name": "$result", + "recipe_result": null, + "status_code": 0 + } +] \ No newline at end of file diff --git a/recipes/recipe_modules/infra_paths/example.py b/recipes/recipe_modules/infra_paths/example.py index 056304e7b..6679aad5d 100644 --- a/recipes/recipe_modules/infra_paths/example.py +++ b/recipes/recipe_modules/infra_paths/example.py @@ -16,7 +16,8 @@ DEPS = [ def RunSteps(api): api.step('show cache path', []) api.step.active_result.presentation.logs['result'] = [ - 'base_paths: %r' % (api.path.c.base_paths,), + str(api.path['cache']), + str(api.infra_paths.default_git_cache_dir), ] @@ -24,7 +25,7 @@ def GenTests(api): yield api.test('basic') for platform in ('linux', 'mac', 'win'): - for path_config in ('buildbot', 'kitchen', 'generic'): + for path_config in ('buildbot', 'kitchen', 'swarmbucket'): yield ( api.test('paths_%s_%s' % (path_config, platform)) + api.platform.name(platform) + diff --git a/recipes/recipe_modules/infra_paths/path_config.py b/recipes/recipe_modules/infra_paths/path_config.py index e63783a2e..9d419451d 100644 --- a/recipes/recipe_modules/infra_paths/path_config.py +++ b/recipes/recipe_modules/infra_paths/path_config.py @@ -51,8 +51,6 @@ def infra_kitchen(c): c.base_paths[path] = c.base_paths['cache'] + (path,) -@CONFIG_CTX() -def infra_generic(c): - c.base_paths['builder_cache'] = c.base_paths['cache'] + ('builder',) - c.base_paths['git_cache'] = c.base_paths['cache'] + ('git',) - c.base_paths['goma_cache'] = c.base_paths['cache'] + ('goma',) +@CONFIG_CTX(includes=['infra_buildbot']) +def infra_swarmbucket(c): + c.base_paths['git_cache'] = c.START_DIR + ('git_cache',)