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

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

Issue 211473006: Add GN (the build tool) to the chromium.linux buildbots and try jobs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: initial patch for review Created 6 years, 9 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/chromium_trybot.py
diff --git a/scripts/slave/recipes/chromium_trybot.py b/scripts/slave/recipes/chromium_trybot.py
index 2dc9dcad2755bad08c516d33efe9bbb059ae0a74..2c4695100802649c17cbdb946b0419464d52a0dd 100644
--- a/scripts/slave/recipes/chromium_trybot.py
+++ b/scripts/slave/recipes/chromium_trybot.py
@@ -243,6 +243,15 @@ def GenSteps(api):
api.chromium.runhooks(),
)
+ # TODO(dpranke): crbug.com/353690. Remove the gn-specific steps from this
+ # recipe and stand up a dedicated GN bot when the GN steps take up enough
+ # resources to be worth it. For now, we run GN and generate files into a new
+ # Debug_gn / build in that dir, and run gn_unittests from that dir (w/o
+ # uploading any test data or parsing the annotations).
+ gn_output_dir = api.path['slave_build'].join(api.chromium.c.BUILD_CONFIG +
+ '_gn')
+ should_run_gn = api.properties.get('buildername') in ('linux', 'linux_rel')
Paweł Hajdan Jr. 2014/03/26 11:44:59 This recipe is not running on any of these builder
Dirk Pranke 2014/03/26 16:52:28 Right! Will fix.
+
test_spec = api.step_history['read test spec'].json.output
test_spec = [s.encode('utf-8') for s in test_spec]
@@ -259,7 +268,14 @@ def GenSteps(api):
name='compile (with patch)',
abort_on_failure=False,
can_fail_build=False)
- if api.step_history['compile (with patch)'].retcode != 0:
+ if should_run_gn:
+ yield api.chromium.run_gn(gn_output_dir)
+ yield api.chromium.compile_with_ninja('compile (gn with patch)',
Paweł Hajdan Jr. 2014/03/26 11:44:59 Shouldn't this _replace_ api.chromium.compile for
Dirk Pranke 2014/03/26 16:52:28 No. This and other comments make me think that you
+ gn_output_dir)
iannucci 2014/03/26 09:38:49 we may want to set 'can_fail_build=False, abort_on
Dirk Pranke 2014/03/26 16:52:28 Good point, will do.
Dirk Pranke 2014/03/26 19:16:35 Oh, I misread this. No, they should be green.
+
+ if ((api.step_history['compile (with patch)'].retcode != 0) or
+ (should_run_gn and
+ api.step_history['compile (gn with patch)'].retcode != 0)):
# Only use LKCR when compile fails. Note that requested specific revision
# can still override this.
api.gclient.set_config('chromium_lkcr')
@@ -274,6 +290,12 @@ def GenSteps(api):
force_clobber=True)
)
+ if should_run_gn:
+ yield api.path.rmcontents('slave gn build directory', gn_output_dir)
Paweł Hajdan Jr. 2014/03/26 11:44:59 Instead of this, could you add force_clobber to th
Dirk Pranke 2014/03/26 16:52:28 Nope :(. force_clobber doesn't support custom outp
+ yield api.chromium.run_gn(gn_output_dir)
+ yield api.chromium.compile_with_ninja(
+ 'compile (gn with patch, lkcr, clobber)', gn_output_dir)
+
# Do not run tests if the build is already in a failed state.
if api.step_history.failed:
return
@@ -281,6 +303,17 @@ def GenSteps(api):
if recipe_config['compile_only']:
return
+ # TODO(dpranke): crbug.com/353690. We can't use runtest() for gn_unittests
+ # on the trybots because of the different output directory; this means
+ # we don't get annotations and don't get retry of the tests for free :( .
+ # For now we'll hope that this is short-lived until we get dedicated GN
+ # trybots, and assume that making runtest() work w/ a differe output dir
iannucci 2014/03/26 09:38:49 *different Though it would be /best/ if we could
Dirk Pranke 2014/03/26 16:52:28 Yes, and I agree that we should probably try to by
+ # is not worth it.
+ if should_run_gn:
+ yield api.step(name='gn_unittests',
+ cmd=[gn_output_dir.join('gn_unittests',
Paweł Hajdan Jr. 2014/03/26 11:44:59 Sorry, all new code added here MUST support retrie
Dirk Pranke 2014/03/26 16:52:28 I forgot to add a TODO -- and will do so -- but I
Dirk Pranke 2014/03/26 19:16:35 Actually, per further discussion w/ Robbie, I'm go
+ platform_ext={'win': '.exe',})])
+
# TODO(phajdan.jr): Make it possible to retry telemtry tests (add JSON).
yield (
api.chromium.run_telemetry_unittests(),
@@ -559,3 +592,30 @@ def GenTests(api):
api.step_data('compile (with patch)', retcode=1) +
api.step_data('compile (with patch, lkcr, clobber)', retcode=1)
)
+
+ # TODO(dpranke): crbug.com/353690.
+ # Remove this when we make GN a standalone recipe.
+ yield (
+ api.test('unittest_should_run_gn') +
+ api.properties.tryserver(buildername='linux', build_config='Debug') +
+ api.platform.name('linux') +
+ api.step_data('compile (gn with patch)', api.json.output(None)) +
Paweł Hajdan Jr. 2014/03/26 11:44:59 These shouldn't be needed after my latest changes.
Dirk Pranke 2014/03/26 16:52:28 Why not?
Dirk Pranke 2014/03/26 19:16:35 Never mind, I think I've got it now.
+ api.step_data('gclient revert') +
+ api.step_data('checkdeps (with patch)', api.json.output(None)) +
+ api.override_step_data('deps2git (with patch)', api.json.output(None)) +
+ api.step_data('nacl_integration (with patch)', api.json.output(None)) +
+ reduce(
+ lambda a, b: a + b,
iannucci 2014/03/26 09:38:49 isn't this the same as sum?
Dirk Pranke 2014/03/26 16:52:28 Think so :). I was just cutting and pasting. Will
Dirk Pranke 2014/03/26 19:16:35 cleaned up on merge.
+ (api.step_data('%s (with patch)' % name, canned_test(passing=True))
+ for name in GTEST_TESTS)
+ )
+ )
+
+ yield (
+ api.test('unittest_should_run_gn_compile_failure') +
+ api.properties.tryserver(buildername='linux', build_config='Debug') +
+ api.platform.name('linux') +
+ api.step_data('compile (gn with patch)', retcode=1) +
+ api.step_data('gclient revert') +
Paweł Hajdan Jr. 2014/03/26 11:44:59 This is likely a no-op.
Dirk Pranke 2014/03/26 16:52:28 I don't know what that means; are you saying I don
Dirk Pranke 2014/03/26 19:16:35 cleaned up on merge.
+ api.step_data('compile (gn with patch, lkcr, clobber)', retcode=1)
+ )

Powered by Google App Engine
This is Rietveld 408576698