Chromium Code Reviews| 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') |
| + ) |
| + ) |