| 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 DEPS = [ | 5 DEPS = [ |
| 6 'chromium', | 6 'chromium', |
| 7 'gclient', | 7 'gclient', |
| 8 'itertools', | 8 'itertools', |
| 9 'json', | 9 'json', |
| 10 'path', | 10 'path', |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 if api.step_history.last_step().retcode != 0: | 261 if api.step_history.last_step().retcode != 0: |
| 262 yield ( | 262 yield ( |
| 263 api.path.rmcontents('slave build directory', api.path['slave_build']), | 263 api.path.rmcontents('slave build directory', api.path['slave_build']), |
| 264 api.gclient.checkout(), | 264 api.gclient.checkout(), |
| 265 api.rietveld.apply_issue(), | 265 api.rietveld.apply_issue(), |
| 266 api.chromium.runhooks(), | 266 api.chromium.runhooks(), |
| 267 ) | 267 ) |
| 268 else: | 268 else: |
| 269 yield api.chromium.runhooks() | 269 yield api.chromium.runhooks() |
| 270 | 270 |
| 271 # TODO(dpranke): crbug.com/353690. Remove the gn-specific steps from this |
| 272 # recipe and stand up a dedicated GN bot when the GN steps take up enough |
| 273 # resources to be worth it. For now, we run GN and generate files into a new |
| 274 # Debug_gn / Release_gn dir, and then run a compile in that dir. |
| 275 gn_output_dir = api.path['slave_build'].join(api.chromium.c.BUILD_CONFIG + |
| 276 '_gn') |
| 277 should_run_gn = api.properties.get('buildername') in ('linux_chromium', |
| 278 'linux_chromium_rel') |
| 279 |
| 271 test_spec = api.step_history['read test spec'].json.output | 280 test_spec = api.step_history['read test spec'].json.output |
| 272 test_spec = [s.encode('utf-8') for s in test_spec] | 281 test_spec = [s.encode('utf-8') for s in test_spec] |
| 273 | 282 |
| 274 tests = [] | 283 tests = [] |
| 275 tests.append(CheckdepsTest()) | 284 tests.append(CheckdepsTest()) |
| 276 tests.append(Deps2GitTest()) | 285 tests.append(Deps2GitTest()) |
| 277 for name in GTEST_TESTS + test_spec: | 286 for name in GTEST_TESTS + test_spec: |
| 278 tests.append(GTestTest(name)) | 287 tests.append(GTestTest(name)) |
| 279 tests.append(NaclIntegrationTest()) | 288 tests.append(NaclIntegrationTest()) |
| 280 | 289 |
| 281 compile_targets = list(api.itertools.chain( | 290 compile_targets = list(api.itertools.chain( |
| 282 *[t.compile_targets() for t in tests])) | 291 *[t.compile_targets() for t in tests])) |
| 283 yield api.chromium.compile(compile_targets, | 292 yield api.chromium.compile(compile_targets, |
| 284 name='compile (with patch)', | 293 name='compile (with patch)', |
| 285 abort_on_failure=False, | 294 abort_on_failure=False, |
| 286 can_fail_build=False) | 295 can_fail_build=False) |
| 287 if api.step_history['compile (with patch)'].retcode != 0: | 296 if should_run_gn: |
| 297 yield api.chromium.run_gn(gn_output_dir) |
| 298 yield api.chromium.compile_with_ninja('compile (gn with patch)', |
| 299 gn_output_dir) |
| 300 |
| 301 if ((api.step_history['compile (with patch)'].retcode != 0) or |
| 302 (should_run_gn and |
| 303 api.step_history['compile (gn with patch)'].retcode != 0)): |
| 288 # Only use LKCR when compile fails. Note that requested specific revision | 304 # Only use LKCR when compile fails. Note that requested specific revision |
| 289 # can still override this. | 305 # can still override this. |
| 290 api.gclient.set_config('chromium_lkcr') | 306 api.gclient.set_config('chromium_lkcr') |
| 291 | 307 |
| 292 # Since we're likely to switch to an earlier revision, revert the patch, | 308 # Since we're likely to switch to an earlier revision, revert the patch, |
| 293 # sync with the new config, and apply issue again. | 309 # sync with the new config, and apply issue again. |
| 294 yield api.gclient.checkout(revert=True) | 310 yield api.gclient.checkout(revert=True) |
| 295 yield api.rietveld.apply_issue() | 311 yield api.rietveld.apply_issue() |
| 296 | 312 |
| 297 # TODO(phajdan.jr): Extend to all platforms, http://crbug.com/354731 . | 313 # TODO(phajdan.jr): Extend to all platforms, http://crbug.com/354731 . |
| (...skipping 11 matching lines...) Expand all Loading... |
| 309 api.chromium.runhooks(), | 325 api.chromium.runhooks(), |
| 310 api.chromium.compile(compile_targets, | 326 api.chromium.compile(compile_targets, |
| 311 name='compile (with patch, lkcr, clobber, nuke)', | 327 name='compile (with patch, lkcr, clobber, nuke)', |
| 312 force_clobber=True) | 328 force_clobber=True) |
| 313 ) | 329 ) |
| 314 else: | 330 else: |
| 315 yield api.chromium.compile(compile_targets, | 331 yield api.chromium.compile(compile_targets, |
| 316 name='compile (with patch, lkcr, clobber)', | 332 name='compile (with patch, lkcr, clobber)', |
| 317 force_clobber=True) | 333 force_clobber=True) |
| 318 | 334 |
| 335 if should_run_gn: |
| 336 yield api.path.rmcontents('slave gn build directory', gn_output_dir) |
| 337 yield api.chromium.run_gn(gn_output_dir) |
| 338 yield api.chromium.compile_with_ninja( |
| 339 'compile (gn with patch, lkcr, clobber)', gn_output_dir) |
| 340 |
| 319 # Do not run tests if the build is already in a failed state. | 341 # Do not run tests if the build is already in a failed state. |
| 320 if api.step_history.failed: | 342 if api.step_history.failed: |
| 321 return | 343 return |
| 322 | 344 |
| 323 if recipe_config['compile_only']: | 345 if recipe_config['compile_only']: |
| 324 return | 346 return |
| 325 | 347 |
| 326 # TODO(phajdan.jr): Make it possible to retry telemtry tests (add JSON). | 348 # TODO(dpranke): crbug.com/353690. It would be good to run gn_unittests |
| 349 # out of the gn build dir, but we can't use runtest() |
| 350 # because of the different output directory; this means |
| 351 # we don't get annotations and don't get retry of the tests for free :( . |
| 352 |
| 353 # TODO(phajdan.jr): Make it possible to retry telemetry tests (add JSON). |
| 327 yield ( | 354 yield ( |
| 328 api.chromium.run_telemetry_unittests(), | 355 api.chromium.run_telemetry_unittests(), |
| 329 api.chromium.run_telemetry_perf_unittests(), | 356 api.chromium.run_telemetry_perf_unittests(), |
| 330 ) | 357 ) |
| 331 | 358 |
| 332 def deapply_patch_fn(failing_tests): | 359 def deapply_patch_fn(failing_tests): |
| 333 yield ( | 360 yield ( |
| 334 api.gclient.revert(), | 361 api.gclient.revert(), |
| 335 api.chromium.runhooks(), | 362 api.chromium.runhooks(), |
| 336 ) | 363 ) |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 ) | 479 ) |
| 453 | 480 |
| 454 yield ( | 481 yield ( |
| 455 api.test('compile_failure_linux') + | 482 api.test('compile_failure_linux') + |
| 456 props() + | 483 props() + |
| 457 api.platform.name('linux') + | 484 api.platform.name('linux') + |
| 458 api.step_data('compile (with patch)', retcode=1) + | 485 api.step_data('compile (with patch)', retcode=1) + |
| 459 api.step_data('compile (with patch, lkcr, clobber)', retcode=1) + | 486 api.step_data('compile (with patch, lkcr, clobber)', retcode=1) + |
| 460 api.step_data('compile (with patch, lkcr, clobber, nuke)', retcode=1) | 487 api.step_data('compile (with patch, lkcr, clobber, nuke)', retcode=1) |
| 461 ) | 488 ) |
| 489 |
| 490 # TODO(dpranke): crbug.com/353690. |
| 491 # Remove this when we make GN a standalone recipe. |
| 492 yield ( |
| 493 api.test('unittest_should_run_gn') + |
| 494 api.properties.tryserver(buildername='linux_chromium', |
| 495 build_config='Debug') + |
| 496 api.platform.name('linux') + |
| 497 api.step_data('compile (gn with patch)') |
| 498 ) |
| 499 |
| 500 yield ( |
| 501 api.test('unittest_should_run_gn_compile_failure') + |
| 502 api.properties.tryserver(buildername='linux_chromium', |
| 503 build_config='Debug') + |
| 504 api.platform.name('linux') + |
| 505 api.step_data('compile (gn with patch)', retcode=1) |
| 506 ) |
| OLD | NEW |