| # Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file |
| # for details. All rights reserved. Use of this source code is governed by a |
| # BSD-style license that can be found in the LICENSE file. |
| |
| from recipe_engine import post_process |
| |
| from PB.recipe_modules.dart.build.build import Build |
| |
| DEPS = [ |
| 'build', |
| 'recipe_engine/properties', |
| 'recipe_engine/step', |
| ] |
| |
| |
| def RunSteps(api): |
| build_args = ['--super-fast'] |
| api.build.build(name='build it', args=build_args) |
| |
| |
| def GenTests(api): |
| yield api.test( |
| 'success', |
| api.post_process(post_process.StatusSuccess), |
| ) |
| |
| yield api.test( |
| 'no-goma', |
| api.properties(**{'$dart/build': Build(disable_goma=True)}), |
| api.post_process(post_process.StepCommandContains, |
| 'build it', [ |
| '--super-fast', |
| '--no-goma', |
| ]), |
| api.post_process(post_process.DoesNotRunRE, '.*goma.*'), |
| api.post_process(post_process.StatusSuccess), |
| ) |
| |
| yield api.test( |
| 'fail', |
| api.step_data('build it', retcode=1), |
| api.post_process(post_process.StatusFailure), |
| ) |
| |
| yield api.test( |
| 'timeout', |
| api.step_data('build it', times_out_after=60 * 61 + 1), |
| api.post_process(post_process.StatusFailure), |
| ) |
| |
| yield api.test( |
| 'custom-timeout', |
| api.properties(**{'$dart/build': Build(timeout=1234)}), |
| api.post_process(post_process.StatusSuccess), |
| api.post_process(post_process.Filter('build it')), |
| ) |