| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Recipe to test v8/node.js integration.""" | 5 """Recipe to test v8/node.js integration.""" |
| 6 | 6 |
| 7 from recipe_engine.types import freeze | 7 from recipe_engine.types import freeze |
| 8 | 8 |
| 9 | 9 |
| 10 DEPS = [ | 10 DEPS = [ |
| 11 'chromium', | 11 'chromium', |
| 12 'depot_tools/gclient', | 12 'depot_tools/gclient', |
| 13 'depot_tools/infra_paths', |
| 13 'file', | 14 'file', |
| 14 'recipe_engine/path', | 15 'recipe_engine/path', |
| 15 'recipe_engine/platform', | 16 'recipe_engine/platform', |
| 16 'recipe_engine/properties', | 17 'recipe_engine/properties', |
| 17 'recipe_engine/python', | 18 'recipe_engine/python', |
| 18 'recipe_engine/step', | 19 'recipe_engine/step', |
| 19 'v8', | 20 'v8', |
| 20 ] | 21 ] |
| 21 | 22 |
| 22 BUILDERS = freeze({ | 23 BUILDERS = freeze({ |
| 23 'client.v8.fyi': { | 24 'client.v8.fyi': { |
| 24 'builders': { | 25 'builders': { |
| 25 'V8 - node.js integration - lkgr': { | 26 'V8 - node.js integration - lkgr': { |
| 26 'testing': { | 27 'testing': { |
| 27 'platform': 'linux', | 28 'platform': 'linux', |
| 28 }, | 29 }, |
| 29 }, | 30 }, |
| 30 }, | 31 }, |
| 31 }, | 32 }, |
| 32 }) | 33 }) |
| 33 | 34 |
| 34 | 35 |
| 35 def _build_and_test(api, suffix=''): | 36 def _build_and_test(api, suffix=''): |
| 36 api.step( | 37 api.step( |
| 37 'configure node.js%s' % suffix, | 38 'configure node.js%s' % suffix, |
| 38 [api.path['slave_build'].join('node.js', 'configure')], | 39 [api.infra_paths['slave_build'].join('node.js', 'configure')], |
| 39 cwd=api.path['slave_build'].join('node.js'), | 40 cwd=api.infra_paths['slave_build'].join('node.js'), |
| 40 ) | 41 ) |
| 41 | 42 |
| 42 api.step( | 43 api.step( |
| 43 'build and test node.js%s' % suffix, | 44 'build and test node.js%s' % suffix, |
| 44 ['make', '-j8', 'test'], | 45 ['make', '-j8', 'test'], |
| 45 cwd=api.path['slave_build'].join('node.js'), | 46 cwd=api.infra_paths['slave_build'].join('node.js'), |
| 46 ) | 47 ) |
| 47 | 48 |
| 48 | 49 |
| 49 def RunSteps(api): | 50 def RunSteps(api): |
| 50 v8 = api.v8 | 51 v8 = api.v8 |
| 51 v8.apply_bot_config(BUILDERS) | 52 v8.apply_bot_config(BUILDERS) |
| 52 api.gclient.apply_config('node_js') | 53 api.gclient.apply_config('node_js') |
| 53 v8.checkout() | 54 v8.checkout() |
| 54 api.chromium.cleanup_temp() | 55 api.chromium.cleanup_temp() |
| 55 | 56 |
| 56 try: | 57 try: |
| 57 # Build and test the node.js branch as FYI. | 58 # Build and test the node.js branch as FYI. |
| 58 _build_and_test(api, ' - baseline') | 59 _build_and_test(api, ' - baseline') |
| 59 except api.step.StepFailure: # pragma: no cover | 60 except api.step.StepFailure: # pragma: no cover |
| 60 pass | 61 pass |
| 61 | 62 |
| 62 # Copy the checked-out v8. | 63 # Copy the checked-out v8. |
| 63 api.file.rmtree('v8', api.path['slave_build'].join('node.js', 'deps', 'v8')) | 64 api.file.rmtree('v8', api.infra_paths['slave_build'].join('node.js', 'deps', '
v8')) |
| 64 api.python( | 65 api.python( |
| 65 name='copy v8 tree', | 66 name='copy v8 tree', |
| 66 script=api.v8.resource('copy_v8.py'), | 67 script=api.v8.resource('copy_v8.py'), |
| 67 args=[ | 68 args=[ |
| 68 # Source. | 69 # Source. |
| 69 api.path['slave_build'].join('v8'), | 70 api.infra_paths['slave_build'].join('v8'), |
| 70 # Destination. | 71 # Destination. |
| 71 api.path['slave_build'].join('node.js', 'deps', 'v8'), | 72 api.infra_paths['slave_build'].join('node.js', 'deps', 'v8'), |
| 72 # Paths to ignore. | 73 # Paths to ignore. |
| 73 '.git', | 74 '.git', |
| 74 api.path['slave_build'].join('v8', 'buildtools'), | 75 api.infra_paths['slave_build'].join('v8', 'buildtools'), |
| 75 api.path['slave_build'].join('v8', 'out'), | 76 api.infra_paths['slave_build'].join('v8', 'out'), |
| 76 api.path['slave_build'].join('v8', 'third_party'), | 77 api.infra_paths['slave_build'].join('v8', 'third_party'), |
| 77 ], | 78 ], |
| 78 ) | 79 ) |
| 79 | 80 |
| 80 # Build and test node.js with the checked-out v8. | 81 # Build and test node.js with the checked-out v8. |
| 81 _build_and_test(api) | 82 _build_and_test(api) |
| 82 | 83 |
| 83 | 84 |
| 84 def _sanitize_nonalpha(text): | 85 def _sanitize_nonalpha(text): |
| 85 return ''.join(c if c.isalnum() else '_' for c in text) | 86 return ''.join(c if c.isalnum() else '_' for c in text) |
| 86 | 87 |
| 87 | 88 |
| 88 def GenTests(api): | 89 def GenTests(api): |
| 89 for mastername, masterconf in BUILDERS.iteritems(): | 90 for mastername, masterconf in BUILDERS.iteritems(): |
| 90 for buildername, _ in masterconf['builders'].iteritems(): | 91 for buildername, _ in masterconf['builders'].iteritems(): |
| 91 yield ( | 92 yield ( |
| 92 api.test('_'.join([ | 93 api.test('_'.join([ |
| 93 'full', | 94 'full', |
| 94 _sanitize_nonalpha(mastername), | 95 _sanitize_nonalpha(mastername), |
| 95 _sanitize_nonalpha(buildername), | 96 _sanitize_nonalpha(buildername), |
| 96 ])) + | 97 ])) + |
| 97 api.properties.generic( | 98 api.properties.generic( |
| 98 mastername=mastername, | 99 mastername=mastername, |
| 99 buildername=buildername, | 100 buildername=buildername, |
| 100 branch='refs/heads/lkgr', | 101 branch='refs/heads/lkgr', |
| 101 revision='deadbeef', | 102 revision='deadbeef', |
| 102 ) | 103 ) |
| 103 ) | 104 ) |
| OLD | NEW |