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

Unified Diff: scripts/slave/recipes/devtools.py

Issue 2290923002: DevTools: Create recipe and builder for devtools (Closed)
Patch Set: Address CL feedback on recipe, new builder config Created 4 years, 3 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
Index: scripts/slave/recipes/devtools.py
diff --git a/scripts/slave/recipes/devtools.py b/scripts/slave/recipes/devtools.py
new file mode 100644
index 0000000000000000000000000000000000000000..02e16b17f9f52cec969622f8debef7524384de7d
--- /dev/null
+++ b/scripts/slave/recipes/devtools.py
@@ -0,0 +1,82 @@
+from recipe_engine.types import freeze
+
+DEPS = [
+ 'chromium_tests',
+ 'depot_tools/bot_update',
+ 'depot_tools/gclient',
+ 'depot_tools/git',
+ 'recipe_engine/path',
+ 'recipe_engine/properties',
+ 'recipe_engine/python',
+ 'recipe_engine/raw_io',
+ 'recipe_engine/shutil',
+ 'recipe_engine/step',
+]
+
+MASTERS = freeze({
+ 'chromium.fyi': {
+ 'buildername': 'DevTools',
Ryan Tseng 2016/09/02 00:12:59 update this
chenwilliam 2016/09/02 18:01:25 Done.
+ 'testname': 'devtools_fyi',
+ },
+})
+
+def RunSteps(api):
+ api.gclient.set_config('chromium')
+ api.bot_update.ensure_checkout(force=True)
+
+ has_devtools_file = False
+ files = api.chromium_tests.get_files_affected_by_patch()
+ for f in files:
+ if f.startswith('third_party/WebKit/Source/devtools'):
+ has_devtools_file = True
+
+ if not has_devtools_file:
+ api.step('skip checks', ['echo', 'no devtools file in patch'])
+ return
+
+ def get_devtools_path(*sub_paths):
+ devtools_sub_path = ('third_party', 'WebKit', 'Source', 'devtools')
+ joined_path = devtools_sub_path + sub_paths
+ return api.path['checkout'].join(*joined_path)
+
+ devtools_path = get_devtools_path()
+ npm_path = get_devtools_path('scripts', 'buildbot', 'npm.py')
+ npm_modules_checkout_path = get_devtools_path('npm_modules')
+ node_modules_src_path = get_devtools_path(
+ 'npm_modules', 'devtools', 'node_modules')
+ node_modules_dest_path = get_devtools_path('node_modules')
+
+ api.python('install node.js and npm', npm_path, ['--version'])
+
+ api.git.checkout(
chenwilliam 2016/09/01 18:00:44 Changed from npm install to just checking out our
+ url='https://chromium.googlesource.com/deps/third_party/npm_modules',
+ ref='master',
+ dir_path=npm_modules_checkout_path)
+
+ api.shutil.rmtree(node_modules_dest_path)
Ryan Tseng 2016/09/02 00:12:59 why?
chenwilliam 2016/09/02 18:01:25 If the npm_modules repo gets updated, I want to ma
Ryan Tseng 2016/09/02 18:10:47 why not just deps in the npm_modules repository in
+ api.shutil.copytree(
+ 'copy npm modules', node_modules_src_path, node_modules_dest_path)
+
+ api.python('run eslint', npm_path, ['run', 'lint'], cwd=devtools_path)
+
+def GenTests(api):
+ for mastername, config in MASTERS.iteritems():
+ yield (
+ api.test(config['testname'] + '_no_devtools_file') +
+ api.properties.generic(
+ buildername=config['buildername'],
+ mastername=mastername,
+ )
+ )
+ yield (
+ api.test(config['testname'] + '_with_devtools_file') +
+ api.properties.generic(
+ buildername=config['buildername'],
+ mastername=mastername,
+ ) +
+ api.override_step_data(
+ 'git diff to analyze patch',
+ api.raw_io.stream_output(
+ 'third_party/WebKit/Source/devtools/fake.js\n')
+ )
+ )
« no previous file with comments | « scripts/slave/recipes/OWNERS ('k') | scripts/slave/recipes/devtools.expected/devtools_fyi_no_devtools_file.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698