aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/bots/recipe_modules
diff options
context:
space:
mode:
Diffstat (limited to 'infra/bots/recipe_modules')
-rw-r--r--infra/bots/recipe_modules/core/api.py13
-rw-r--r--infra/bots/recipe_modules/infra/example.expected/failed_all_updates.json77
-rw-r--r--infra/bots/recipe_modules/infra/example.expected/failed_one_update.json88
-rw-r--r--infra/bots/recipe_modules/infra/example.expected/infra_tests.json88
-rw-r--r--infra/bots/recipe_modules/infra/example.py16
-rw-r--r--infra/bots/recipe_modules/vars/api.py34
6 files changed, 13 insertions, 303 deletions
diff --git a/infra/bots/recipe_modules/core/api.py b/infra/bots/recipe_modules/core/api.py
index 623189183c..005ee27733 100644
--- a/infra/bots/recipe_modules/core/api.py
+++ b/infra/bots/recipe_modules/core/api.py
@@ -144,13 +144,12 @@ class SkiaApi(recipe_api.RecipeApi):
# Run bot_update.
# Hack the patch ref if necessary.
- if self.m.properties.get('patch_storage', '') == 'gerrit':
- if self.m.bot_update._issue and self.m.bot_update._patchset:
- self.m.bot_update._gerrit_ref = 'refs/changes/%s/%d/%d' % (
- str(self.m.bot_update._issue)[-2:],
- self.m.bot_update._issue,
- self.m.bot_update._patchset,
- )
+ if self.m.bot_update._issue and self.m.bot_update._patchset:
+ self.m.bot_update._gerrit_ref = 'refs/changes/%s/%d/%d' % (
+ str(self.m.bot_update._issue)[-2:],
+ self.m.bot_update._issue,
+ self.m.bot_update._patchset,
+ )
self.m.gclient.c = gclient_cfg
with self.m.step.context({'cwd': self.m.vars.checkout_root}):
diff --git a/infra/bots/recipe_modules/infra/example.expected/failed_all_updates.json b/infra/bots/recipe_modules/infra/example.expected/failed_all_updates.json
index a5ba6b1b7b..eac033852b 100644
--- a/infra/bots/recipe_modules/infra/example.expected/failed_all_updates.json
+++ b/infra/bots/recipe_modules/infra/example.expected/failed_all_updates.json
@@ -1,83 +1,6 @@
[
{
"cmd": [
- "python",
- "-u",
- "\nimport sys, os\npath = sys.argv[1]\nmode = int(sys.argv[2])\nif not os.path.isdir(path):\n if os.path.exists(path):\n print \"%s exists but is not a dir\" % path\n sys.exit(1)\n os.makedirs(path, mode)\n",
- "[CUSTOM_/_B_WORK]",
- "511"
- ],
- "infra_step": true,
- "name": "makedirs checkout_path",
- "~followup_annotations": [
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@import sys, os@@@",
- "@@@STEP_LOG_LINE@python.inline@path = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@mode = int(sys.argv[2])@@@",
- "@@@STEP_LOG_LINE@python.inline@if not os.path.isdir(path):@@@",
- "@@@STEP_LOG_LINE@python.inline@ if os.path.exists(path):@@@",
- "@@@STEP_LOG_LINE@python.inline@ print \"%s exists but is not a dir\" % path@@@",
- "@@@STEP_LOG_LINE@python.inline@ sys.exit(1)@@@",
- "@@@STEP_LOG_LINE@python.inline@ os.makedirs(path, mode)@@@",
- "@@@STEP_LOG_END@python.inline@@@"
- ]
- },
- {
- "cmd": [
- "python",
- "-u",
- "RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
- "--spec",
- "cache_dir = '[CUSTOM_/_B_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': False, 'name': 'skia', 'url': 'https://skia.googlesource.com/skia.git'}]",
- "--patch_root",
- "skia",
- "--revision_mapping_file",
- "{\"skia\": \"got_revision\"}",
- "--git-cache-dir",
- "[CUSTOM_/_B_CACHE]",
- "--output_json",
- "/path/to/tmp/json",
- "--revision",
- "skia@abc123",
- "--output_manifest"
- ],
- "cwd": "[CUSTOM_/_B_WORK]",
- "env": {
- "GIT_HTTP_LOW_SPEED_LIMIT": "1000",
- "GIT_HTTP_LOW_SPEED_TIME": "300",
- "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
- },
- "infra_step": true,
- "name": "bot_update",
- "~followup_annotations": [
- "@@@STEP_TEXT@Some step text@@@",
- "@@@STEP_LOG_LINE@json.output@{@@@",
- "@@@STEP_LOG_LINE@json.output@ \"did_run\": true, @@@",
- "@@@STEP_LOG_LINE@json.output@ \"fixed_revisions\": {@@@",
- "@@@STEP_LOG_LINE@json.output@ \"skia\": \"abc123\"@@@",
- "@@@STEP_LOG_LINE@json.output@ }, @@@",
- "@@@STEP_LOG_LINE@json.output@ \"manifest\": {@@@",
- "@@@STEP_LOG_LINE@json.output@ \"skia\": {@@@",
- "@@@STEP_LOG_LINE@json.output@ \"repository\": \"https://fake.org/skia.git\", @@@",
- "@@@STEP_LOG_LINE@json.output@ \"revision\": \"9046e2e693bb92a76e972b694580e5d17ad10748\"@@@",
- "@@@STEP_LOG_LINE@json.output@ }@@@",
- "@@@STEP_LOG_LINE@json.output@ }, @@@",
- "@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false, @@@",
- "@@@STEP_LOG_LINE@json.output@ \"patch_root\": \"skia\", @@@",
- "@@@STEP_LOG_LINE@json.output@ \"properties\": {@@@",
- "@@@STEP_LOG_LINE@json.output@ \"got_revision\": \"9046e2e693bb92a76e972b694580e5d17ad10748\", @@@",
- "@@@STEP_LOG_LINE@json.output@ \"got_revision_cp\": \"refs/heads/master@{#164710}\"@@@",
- "@@@STEP_LOG_LINE@json.output@ }, @@@",
- "@@@STEP_LOG_LINE@json.output@ \"root\": \"skia\", @@@",
- "@@@STEP_LOG_LINE@json.output@ \"step_text\": \"Some step text\"@@@",
- "@@@STEP_LOG_LINE@json.output@}@@@",
- "@@@STEP_LOG_END@json.output@@@",
- "@@@SET_BUILD_PROPERTY@got_revision@\"9046e2e693bb92a76e972b694580e5d17ad10748\"@@@",
- "@@@SET_BUILD_PROPERTY@got_revision_cp@\"refs/heads/master@{#164710}\"@@@"
- ]
- },
- {
- "cmd": [
"go",
"get",
"-u",
diff --git a/infra/bots/recipe_modules/infra/example.expected/failed_one_update.json b/infra/bots/recipe_modules/infra/example.expected/failed_one_update.json
index 68f0e41dd2..46f683eb97 100644
--- a/infra/bots/recipe_modules/infra/example.expected/failed_one_update.json
+++ b/infra/bots/recipe_modules/infra/example.expected/failed_one_update.json
@@ -1,83 +1,6 @@
[
{
"cmd": [
- "python",
- "-u",
- "\nimport sys, os\npath = sys.argv[1]\nmode = int(sys.argv[2])\nif not os.path.isdir(path):\n if os.path.exists(path):\n print \"%s exists but is not a dir\" % path\n sys.exit(1)\n os.makedirs(path, mode)\n",
- "[CUSTOM_/_B_WORK]",
- "511"
- ],
- "infra_step": true,
- "name": "makedirs checkout_path",
- "~followup_annotations": [
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@import sys, os@@@",
- "@@@STEP_LOG_LINE@python.inline@path = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@mode = int(sys.argv[2])@@@",
- "@@@STEP_LOG_LINE@python.inline@if not os.path.isdir(path):@@@",
- "@@@STEP_LOG_LINE@python.inline@ if os.path.exists(path):@@@",
- "@@@STEP_LOG_LINE@python.inline@ print \"%s exists but is not a dir\" % path@@@",
- "@@@STEP_LOG_LINE@python.inline@ sys.exit(1)@@@",
- "@@@STEP_LOG_LINE@python.inline@ os.makedirs(path, mode)@@@",
- "@@@STEP_LOG_END@python.inline@@@"
- ]
- },
- {
- "cmd": [
- "python",
- "-u",
- "RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
- "--spec",
- "cache_dir = '[CUSTOM_/_B_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': False, 'name': 'skia', 'url': 'https://skia.googlesource.com/skia.git'}]",
- "--patch_root",
- "skia",
- "--revision_mapping_file",
- "{\"skia\": \"got_revision\"}",
- "--git-cache-dir",
- "[CUSTOM_/_B_CACHE]",
- "--output_json",
- "/path/to/tmp/json",
- "--revision",
- "skia@abc123",
- "--output_manifest"
- ],
- "cwd": "[CUSTOM_/_B_WORK]",
- "env": {
- "GIT_HTTP_LOW_SPEED_LIMIT": "1000",
- "GIT_HTTP_LOW_SPEED_TIME": "300",
- "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
- },
- "infra_step": true,
- "name": "bot_update",
- "~followup_annotations": [
- "@@@STEP_TEXT@Some step text@@@",
- "@@@STEP_LOG_LINE@json.output@{@@@",
- "@@@STEP_LOG_LINE@json.output@ \"did_run\": true, @@@",
- "@@@STEP_LOG_LINE@json.output@ \"fixed_revisions\": {@@@",
- "@@@STEP_LOG_LINE@json.output@ \"skia\": \"abc123\"@@@",
- "@@@STEP_LOG_LINE@json.output@ }, @@@",
- "@@@STEP_LOG_LINE@json.output@ \"manifest\": {@@@",
- "@@@STEP_LOG_LINE@json.output@ \"skia\": {@@@",
- "@@@STEP_LOG_LINE@json.output@ \"repository\": \"https://fake.org/skia.git\", @@@",
- "@@@STEP_LOG_LINE@json.output@ \"revision\": \"9046e2e693bb92a76e972b694580e5d17ad10748\"@@@",
- "@@@STEP_LOG_LINE@json.output@ }@@@",
- "@@@STEP_LOG_LINE@json.output@ }, @@@",
- "@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false, @@@",
- "@@@STEP_LOG_LINE@json.output@ \"patch_root\": \"skia\", @@@",
- "@@@STEP_LOG_LINE@json.output@ \"properties\": {@@@",
- "@@@STEP_LOG_LINE@json.output@ \"got_revision\": \"9046e2e693bb92a76e972b694580e5d17ad10748\", @@@",
- "@@@STEP_LOG_LINE@json.output@ \"got_revision_cp\": \"refs/heads/master@{#164710}\"@@@",
- "@@@STEP_LOG_LINE@json.output@ }, @@@",
- "@@@STEP_LOG_LINE@json.output@ \"root\": \"skia\", @@@",
- "@@@STEP_LOG_LINE@json.output@ \"step_text\": \"Some step text\"@@@",
- "@@@STEP_LOG_LINE@json.output@}@@@",
- "@@@STEP_LOG_END@json.output@@@",
- "@@@SET_BUILD_PROPERTY@got_revision@\"9046e2e693bb92a76e972b694580e5d17ad10748\"@@@",
- "@@@SET_BUILD_PROPERTY@got_revision_cp@\"refs/heads/master@{#164710}\"@@@"
- ]
- },
- {
- "cmd": [
"go",
"get",
"-u",
@@ -115,17 +38,6 @@
"name": "update go pkgs (attempt 2)"
},
{
- "cmd": [
- "python",
- "[CUSTOM_/_B_WORK]/skia/infra/bots/infra_tests.py"
- ],
- "cwd": "[CUSTOM_/_B_WORK]/skia",
- "env": {
- "GOPATH": "[CUSTOM_/_B_WORK]/gopath"
- },
- "name": "infra_tests"
- },
- {
"name": "$result",
"recipe_result": null,
"status_code": 0
diff --git a/infra/bots/recipe_modules/infra/example.expected/infra_tests.json b/infra/bots/recipe_modules/infra/example.expected/infra_tests.json
index 1576173738..2e27ea52c8 100644
--- a/infra/bots/recipe_modules/infra/example.expected/infra_tests.json
+++ b/infra/bots/recipe_modules/infra/example.expected/infra_tests.json
@@ -1,83 +1,6 @@
[
{
"cmd": [
- "python",
- "-u",
- "\nimport sys, os\npath = sys.argv[1]\nmode = int(sys.argv[2])\nif not os.path.isdir(path):\n if os.path.exists(path):\n print \"%s exists but is not a dir\" % path\n sys.exit(1)\n os.makedirs(path, mode)\n",
- "[CUSTOM_/_B_WORK]",
- "511"
- ],
- "infra_step": true,
- "name": "makedirs checkout_path",
- "~followup_annotations": [
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@import sys, os@@@",
- "@@@STEP_LOG_LINE@python.inline@path = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@mode = int(sys.argv[2])@@@",
- "@@@STEP_LOG_LINE@python.inline@if not os.path.isdir(path):@@@",
- "@@@STEP_LOG_LINE@python.inline@ if os.path.exists(path):@@@",
- "@@@STEP_LOG_LINE@python.inline@ print \"%s exists but is not a dir\" % path@@@",
- "@@@STEP_LOG_LINE@python.inline@ sys.exit(1)@@@",
- "@@@STEP_LOG_LINE@python.inline@ os.makedirs(path, mode)@@@",
- "@@@STEP_LOG_END@python.inline@@@"
- ]
- },
- {
- "cmd": [
- "python",
- "-u",
- "RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
- "--spec",
- "cache_dir = '[CUSTOM_/_B_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': False, 'name': 'skia', 'url': 'https://skia.googlesource.com/skia.git'}]",
- "--patch_root",
- "skia",
- "--revision_mapping_file",
- "{\"skia\": \"got_revision\"}",
- "--git-cache-dir",
- "[CUSTOM_/_B_CACHE]",
- "--output_json",
- "/path/to/tmp/json",
- "--revision",
- "skia@abc123",
- "--output_manifest"
- ],
- "cwd": "[CUSTOM_/_B_WORK]",
- "env": {
- "GIT_HTTP_LOW_SPEED_LIMIT": "1000",
- "GIT_HTTP_LOW_SPEED_TIME": "300",
- "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
- },
- "infra_step": true,
- "name": "bot_update",
- "~followup_annotations": [
- "@@@STEP_TEXT@Some step text@@@",
- "@@@STEP_LOG_LINE@json.output@{@@@",
- "@@@STEP_LOG_LINE@json.output@ \"did_run\": true, @@@",
- "@@@STEP_LOG_LINE@json.output@ \"fixed_revisions\": {@@@",
- "@@@STEP_LOG_LINE@json.output@ \"skia\": \"abc123\"@@@",
- "@@@STEP_LOG_LINE@json.output@ }, @@@",
- "@@@STEP_LOG_LINE@json.output@ \"manifest\": {@@@",
- "@@@STEP_LOG_LINE@json.output@ \"skia\": {@@@",
- "@@@STEP_LOG_LINE@json.output@ \"repository\": \"https://fake.org/skia.git\", @@@",
- "@@@STEP_LOG_LINE@json.output@ \"revision\": \"9046e2e693bb92a76e972b694580e5d17ad10748\"@@@",
- "@@@STEP_LOG_LINE@json.output@ }@@@",
- "@@@STEP_LOG_LINE@json.output@ }, @@@",
- "@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false, @@@",
- "@@@STEP_LOG_LINE@json.output@ \"patch_root\": \"skia\", @@@",
- "@@@STEP_LOG_LINE@json.output@ \"properties\": {@@@",
- "@@@STEP_LOG_LINE@json.output@ \"got_revision\": \"9046e2e693bb92a76e972b694580e5d17ad10748\", @@@",
- "@@@STEP_LOG_LINE@json.output@ \"got_revision_cp\": \"refs/heads/master@{#164710}\"@@@",
- "@@@STEP_LOG_LINE@json.output@ }, @@@",
- "@@@STEP_LOG_LINE@json.output@ \"root\": \"skia\", @@@",
- "@@@STEP_LOG_LINE@json.output@ \"step_text\": \"Some step text\"@@@",
- "@@@STEP_LOG_LINE@json.output@}@@@",
- "@@@STEP_LOG_END@json.output@@@",
- "@@@SET_BUILD_PROPERTY@got_revision@\"9046e2e693bb92a76e972b694580e5d17ad10748\"@@@",
- "@@@SET_BUILD_PROPERTY@got_revision_cp@\"refs/heads/master@{#164710}\"@@@"
- ]
- },
- {
- "cmd": [
"go",
"get",
"-u",
@@ -94,17 +17,6 @@
"name": "update go pkgs"
},
{
- "cmd": [
- "python",
- "[CUSTOM_/_B_WORK]/skia/infra/bots/infra_tests.py"
- ],
- "cwd": "[CUSTOM_/_B_WORK]/skia",
- "env": {
- "GOPATH": "[CUSTOM_/_B_WORK]/gopath"
- },
- "name": "infra_tests"
- },
- {
"name": "$result",
"recipe_result": null,
"status_code": 0
diff --git a/infra/bots/recipe_modules/infra/example.py b/infra/bots/recipe_modules/infra/example.py
index f243c1b565..d46a7ee42f 100644
--- a/infra/bots/recipe_modules/infra/example.py
+++ b/infra/bots/recipe_modules/infra/example.py
@@ -19,23 +19,13 @@ DEPS = [
def RunSteps(api):
api.vars.setup()
- api.core.checkout_steps()
api.infra.update_go_deps()
- # Run the infra tests.
- infra_tests = api.vars.skia_dir.join(
- 'infra', 'bots', 'infra_tests.py')
- with api.step.context({'cwd': api.vars.skia_dir, 'env': api.infra.go_env}):
- api.step('infra_tests', cmd=['python', infra_tests])
-
def GenTests(api):
yield (
api.test('infra_tests') +
api.properties(buildername='Housekeeper-PerCommit-InfraTests',
- mastername='client.skia.fyi',
- slavename='dummy-slave',
- buildnumber=5,
repository='https://skia.googlesource.com/skia.git',
revision='abc123',
path_config='kitchen',
@@ -45,9 +35,6 @@ def GenTests(api):
yield (
api.test('failed_one_update') +
api.properties(buildername='Housekeeper-PerCommit-InfraTests',
- mastername='client.skia.fyi',
- slavename='dummy-slave',
- buildnumber=5,
repository='https://skia.googlesource.com/skia.git',
revision='abc123',
path_config='kitchen',
@@ -58,9 +45,6 @@ def GenTests(api):
yield (
api.test('failed_all_updates') +
api.properties(buildername='Housekeeper-PerCommit-InfraTests',
- mastername='client.skia.fyi',
- slavename='dummy-slave',
- buildnumber=5,
repository='https://skia.googlesource.com/skia.git',
revision='abc123',
path_config='kitchen',
diff --git a/infra/bots/recipe_modules/vars/api.py b/infra/bots/recipe_modules/vars/api.py
index 3dd3c3ae96..a40271e788 100644
--- a/infra/bots/recipe_modules/vars/api.py
+++ b/infra/bots/recipe_modules/vars/api.py
@@ -25,9 +25,6 @@ class SkiaVarsApi(recipe_api.RecipeApi):
"""Prepare the variables."""
# Setup
self.builder_name = self.m.properties['buildername']
- self.master_name = self.m.properties['mastername']
- self.slave_name = self.m.properties['slavename']
- self.build_number = self.m.properties['buildnumber']
self.slave_dir = self.m.path['start_dir']
self.checkout_root = self.slave_dir
@@ -38,8 +35,6 @@ class SkiaVarsApi(recipe_api.RecipeApi):
])
self.gclient_env = {}
self.is_compile_bot = self.builder_name.startswith('Build-')
- self.no_buildbot = self.m.properties.get('nobuildbot', '') == 'True'
- self.skia_task_id = self.m.properties.get('skia_task_id', None)
self.default_env['CHROME_HEADLESS'] = '1'
# The 'depot_tools' directory comes from recipe DEPS and isn't provided by
@@ -127,30 +122,15 @@ class SkiaVarsApi(recipe_api.RecipeApi):
self.default_env.update({'SKIA_OUT': self.skia_out,
'BUILDTYPE': self.configuration})
- self.patch_storage = self.m.properties.get('patch_storage', 'rietveld')
+ self.patch_storage = self.m.properties.get('patch_storage', 'gerrit')
self.issue = None
self.patchset = None
- if self.no_buildbot:
- self.is_trybot = False
- if (self.m.properties.get('issue', '') and
- self.m.properties.get('patchset', '')):
- self.is_trybot = True
- self.issue = self.m.properties['issue']
- self.patchset = self.m.properties['patchset']
- elif (self.m.properties.get('patch_issue', '') and
- self.m.properties.get('patch_set', '')):
- self.is_trybot = True
- self.issue = self.m.properties['patch_issue']
- self.patchset = self.m.properties['patch_set']
- else:
- self.is_trybot = self.builder_cfg['is_trybot']
- if self.is_trybot:
- if self.patch_storage == 'gerrit':
- self.issue = self.m.properties['patch_issue']
- self.patchset = self.m.properties['patch_set']
- else:
- self.issue = self.m.properties['issue']
- self.patchset = self.m.properties['patchset']
+ self.is_trybot = False
+ if (self.m.properties.get('patch_issue', '') and
+ self.m.properties.get('patch_set', '')):
+ self.is_trybot = True
+ self.issue = self.m.properties['patch_issue']
+ self.patchset = self.m.properties['patch_set']
self.dm_dir = self.m.path.join(
self.swarming_out_dir, 'dm')