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

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

Issue 2290923002: DevTools: Create recipe and builder for devtools (Closed)
Patch Set: add comments to devtools.py 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..791e063f9d3b9bc0515937f7685533c108ac1d64
--- /dev/null
+++ b/scripts/slave/recipes/devtools.py
@@ -0,0 +1,91 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+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': 'Chromium DevTools Linux',
+ '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'])
+
+ # TODO(chenwilliam): instead of checkout here, add it as DEPS
+ api.git.checkout(
+ url='https://chromium.googlesource.com/deps/third_party/npm_modules',
+ # TODO(chenwilliam): pin this ref to a specific commit
+ ref='master',
+ dir_path=npm_modules_checkout_path)
+
+ # Moving the node_modules folder within the npm_modules git checkout
+ # because npm expects a certain directory layout
+ # this is a naive approach to ensure we're using the latest npm_modules
+ api.shutil.rmtree(node_modules_dest_path)
+ 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