Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 from recipe_engine.types import freeze | |
| 2 | |
| 3 DEPS = [ | |
| 4 'chromium_tests', | |
| 5 'depot_tools/bot_update', | |
| 6 'depot_tools/gclient', | |
| 7 'depot_tools/git', | |
| 8 'recipe_engine/path', | |
| 9 'recipe_engine/properties', | |
| 10 'recipe_engine/python', | |
| 11 'recipe_engine/raw_io', | |
| 12 'recipe_engine/shutil', | |
| 13 'recipe_engine/step', | |
| 14 ] | |
| 15 | |
| 16 MASTERS = freeze({ | |
| 17 'chromium.fyi': { | |
| 18 'buildername': 'DevTools', | |
|
Ryan Tseng
2016/09/02 00:12:59
update this
chenwilliam
2016/09/02 18:01:25
Done.
| |
| 19 'testname': 'devtools_fyi', | |
| 20 }, | |
| 21 }) | |
| 22 | |
| 23 def RunSteps(api): | |
| 24 api.gclient.set_config('chromium') | |
| 25 api.bot_update.ensure_checkout(force=True) | |
| 26 | |
| 27 has_devtools_file = False | |
| 28 files = api.chromium_tests.get_files_affected_by_patch() | |
| 29 for f in files: | |
| 30 if f.startswith('third_party/WebKit/Source/devtools'): | |
| 31 has_devtools_file = True | |
| 32 | |
| 33 if not has_devtools_file: | |
| 34 api.step('skip checks', ['echo', 'no devtools file in patch']) | |
| 35 return | |
| 36 | |
| 37 def get_devtools_path(*sub_paths): | |
| 38 devtools_sub_path = ('third_party', 'WebKit', 'Source', 'devtools') | |
| 39 joined_path = devtools_sub_path + sub_paths | |
| 40 return api.path['checkout'].join(*joined_path) | |
| 41 | |
| 42 devtools_path = get_devtools_path() | |
| 43 npm_path = get_devtools_path('scripts', 'buildbot', 'npm.py') | |
| 44 npm_modules_checkout_path = get_devtools_path('npm_modules') | |
| 45 node_modules_src_path = get_devtools_path( | |
| 46 'npm_modules', 'devtools', 'node_modules') | |
| 47 node_modules_dest_path = get_devtools_path('node_modules') | |
| 48 | |
| 49 api.python('install node.js and npm', npm_path, ['--version']) | |
| 50 | |
| 51 api.git.checkout( | |
|
chenwilliam
2016/09/01 18:00:44
Changed from npm install to just checking out our
| |
| 52 url='https://chromium.googlesource.com/deps/third_party/npm_modules', | |
| 53 ref='master', | |
| 54 dir_path=npm_modules_checkout_path) | |
| 55 | |
| 56 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
| |
| 57 api.shutil.copytree( | |
| 58 'copy npm modules', node_modules_src_path, node_modules_dest_path) | |
| 59 | |
| 60 api.python('run eslint', npm_path, ['run', 'lint'], cwd=devtools_path) | |
| 61 | |
| 62 def GenTests(api): | |
| 63 for mastername, config in MASTERS.iteritems(): | |
| 64 yield ( | |
| 65 api.test(config['testname'] + '_no_devtools_file') + | |
| 66 api.properties.generic( | |
| 67 buildername=config['buildername'], | |
| 68 mastername=mastername, | |
| 69 ) | |
| 70 ) | |
| 71 yield ( | |
| 72 api.test(config['testname'] + '_with_devtools_file') + | |
| 73 api.properties.generic( | |
| 74 buildername=config['buildername'], | |
| 75 mastername=mastername, | |
| 76 ) + | |
| 77 api.override_step_data( | |
| 78 'git diff to analyze patch', | |
| 79 api.raw_io.stream_output( | |
| 80 'third_party/WebKit/Source/devtools/fake.js\n') | |
| 81 ) | |
| 82 ) | |
| OLD | NEW |