aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/bots/recipe_modules/flavor
diff options
context:
space:
mode:
authorGravatar Kevin Lubick <kjlubick@google.com>2018-03-01 09:21:38 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-01 14:38:44 +0000
commitc6f74ca674c4d6cd5965f5c14d1042e4148f0f68 (patch)
tree4a80fdd731971e048263d6118ffcb3dc50f65d6c /infra/bots/recipe_modules/flavor
parent5ebaf194445073e920e6a87af0b76f4929640e51 (diff)
Change force_quarantine to use bot id
Bug: skia:7639 Change-Id: I4b8337bac996062c41fb9ae7460cf214b7524a46 Reviewed-on: https://skia-review.googlesource.com/111300 Reviewed-by: Ravi Mistry <rmistry@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
Diffstat (limited to 'infra/bots/recipe_modules/flavor')
-rw-r--r--infra/bots/recipe_modules/flavor/examples/full.expected/failed_infra_step.json16
-rw-r--r--infra/bots/recipe_modules/flavor/examples/full.expected/retry_adb_command_retries_exhausted.json16
-rw-r--r--infra/bots/recipe_modules/flavor/examples/full.py4
-rw-r--r--infra/bots/recipe_modules/flavor/gn_android_flavor.py4
4 files changed, 37 insertions, 3 deletions
diff --git a/infra/bots/recipe_modules/flavor/examples/full.expected/failed_infra_step.json b/infra/bots/recipe_modules/flavor/examples/full.expected/failed_infra_step.json
index 9ef53509da..b1a252b4af 100644
--- a/infra/bots/recipe_modules/flavor/examples/full.expected/failed_infra_step.json
+++ b/infra/bots/recipe_modules/flavor/examples/full.expected/failed_infra_step.json
@@ -1025,12 +1025,26 @@
"cmd": [
"python",
"-u",
+ "import os\nprint os.environ.get('SWARMING_BOT_ID', '')\n"
+ ],
+ "name": "get swarming bot id",
+ "stdout": "/path/to/tmp/",
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@print os.environ.get('SWARMING_BOT_ID', '')@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
"RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
"--json-output",
"/path/to/tmp/json",
"copy",
" ",
- "/home/chrome-bot/force_quarantine"
+ "/home/chrome-bot/build123-m2--device5.force_quarantine"
],
"infra_step": true,
"name": "Quarantining Bot"
diff --git a/infra/bots/recipe_modules/flavor/examples/full.expected/retry_adb_command_retries_exhausted.json b/infra/bots/recipe_modules/flavor/examples/full.expected/retry_adb_command_retries_exhausted.json
index 01133125fd..9bbd373d06 100644
--- a/infra/bots/recipe_modules/flavor/examples/full.expected/retry_adb_command_retries_exhausted.json
+++ b/infra/bots/recipe_modules/flavor/examples/full.expected/retry_adb_command_retries_exhausted.json
@@ -298,12 +298,26 @@
"cmd": [
"python",
"-u",
+ "import os\nprint os.environ.get('SWARMING_BOT_ID', '')\n"
+ ],
+ "name": "get swarming bot id",
+ "stdout": "/path/to/tmp/",
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@print os.environ.get('SWARMING_BOT_ID', '')@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
"RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
"--json-output",
"/path/to/tmp/json",
"copy",
" ",
- "/home/chrome-bot/force_quarantine"
+ "/home/chrome-bot/build123-m2--device5.force_quarantine"
],
"infra_step": true,
"name": "Quarantining Bot"
diff --git a/infra/bots/recipe_modules/flavor/examples/full.py b/infra/bots/recipe_modules/flavor/examples/full.py
index c86c7701db..d365e0bcd6 100644
--- a/infra/bots/recipe_modules/flavor/examples/full.py
+++ b/infra/bots/recipe_modules/flavor/examples/full.py
@@ -160,6 +160,8 @@ def GenTests(api):
revision='abc123',
path_config='kitchen',
swarm_out_dir='[SWARM_OUT_DIR]') +
+ api.step_data('get swarming bot id',
+ stdout=api.raw_io.output('build123-m2--device5')) +
api.step_data('dump log', retcode=1)
)
@@ -196,6 +198,8 @@ def GenTests(api):
revision='abc123',
path_config='kitchen',
swarm_out_dir='[SWARM_OUT_DIR]') +
+ api.step_data('get swarming bot id',
+ stdout=api.raw_io.output('build123-m2--device5')) +
api.step_data(fail_step_name, retcode=1) +
api.step_data(fail_step_name + ' (attempt 2)', retcode=1) +
api.step_data(fail_step_name + ' (attempt 3)', retcode=1)
diff --git a/infra/bots/recipe_modules/flavor/gn_android_flavor.py b/infra/bots/recipe_modules/flavor/gn_android_flavor.py
index 4aef5dd1f2..ddff49661f 100644
--- a/infra/bots/recipe_modules/flavor/gn_android_flavor.py
+++ b/infra/bots/recipe_modules/flavor/gn_android_flavor.py
@@ -494,8 +494,10 @@ wait_for_device()
# broken state; it was just rebooting.
if (self.m.run.failed_steps and
isinstance(self.m.run.failed_steps[0], recipe_api.InfraFailure)):
+ bot_id = self.m.vars.swarming_bot_id
self.m.file.write_text('Quarantining Bot',
- '/home/chrome-bot/force_quarantine', ' ')
+ '/home/chrome-bot/%s.force_quarantine' % bot_id,
+ ' ')
if self._ever_ran_adb:
self._adb('kill adb server', 'kill-server')