Attempt to fix recipe
Saw error `cwd '/b/s/w/ir/cache/builder/src' is not a directory`
because '/src' won't exist until after we checkout.
Change-Id: I569d7c5724c83f6af01b4391cec03780892e744c
diff --git a/recipes/recipes/luci-test.expected/basic.json b/recipes/recipes/luci-test.expected/basic.json
index 2cdb098..229efb9 100644
--- a/recipes/recipes/luci-test.expected/basic.json
+++ b/recipes/recipes/luci-test.expected/basic.json
@@ -17,7 +17,7 @@
"-o",
"DOWNLOAD_COMMANDS"
],
- "cwd": "[CACHE]/builder/src",
+ "cwd": "[CACHE]/builder",
"env": {
"PATH": "<PATH>:RECIPE_REPO[depot_tools]"
},
@@ -78,7 +78,7 @@
"--refs",
"refs/heads/main"
],
- "cwd": "[CACHE]/builder/src",
+ "cwd": "[CACHE]/builder",
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "gerrit/try/builder/8945511751514863184",
"GIT_HTTP_LOW_SPEED_LIMIT": "102400",
diff --git a/recipes/recipes/luci-test.py b/recipes/recipes/luci-test.py
index 9aefb65..e32033c 100644
--- a/recipes/recipes/luci-test.py
+++ b/recipes/recipes/luci-test.py
@@ -2,7 +2,7 @@
# Reference: https://chromium.googlesource.com/infra/luci/recipes-py/+/HEAD/doc/
-# All the deps get combined into an `api` variable passed in to RunSteps and
+# All the deps get combined into an `api` variable passed in to RunSteps and
# GenTests. Versions and urls are specified in `recipes.cfg`.
DEPS = [
'depot_tools/bot_update',
@@ -28,16 +28,20 @@
gclient_config = api.gclient.make_config()
s = gclient_config.solutions.add()
s.url = 'https://%s/%s' % (host, cl.project)
- # This is the name of the subfolder under api.path['cache'].join('builder')
+ # This is the name of the subfolder under api.path['cache'].join('builder')
# where the repo will be checked out at.
s.name = 'src'
gclient_config.got_revision_mapping[s.name] = 'got_revision'
- with api.context(cwd=api.path['cache'].join('builder').join(s.name)):
- # Check out the code for the change, this is by default cached between
- # builds for the same builder.
+ # Check out the code for the change, this is by default cached between builds
+ # for the same builder.
+ with api.context(cwd=api.path['cache'].join('builder')):
update_result = api.bot_update.ensure_checkout(
gclient_config=gclient_config)
+ api.step.raise_on_failure(update_result)
+
+ # Now in the checked out code directory run our verification.
+ with api.context(cwd=api.path['cache'].join('builder').join(s.name)):
with api.nodejs(version='8.3.0'):
# Named steps to test the change
api.step('install deps', ['npm', 'install'])