blob: 909a13062a116512ddd37e6f9453c201c0def33d [file] [log] [blame]
# 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/path',
'recipe_engine/properties',
'recipe_engine/step',
]
PYTHON_VERSION_COMPATIBILITY = "PY3"
def RunSteps(api):
build_args = ['--super-fast']
api.build.build(name='build it', args=build_args)
def GenTests(api):
yield api.test(
'success',
# Default status is SUCCESS, so this is not strictly needed.
status='SUCCESS',
)
yield api.test(
'rbe',
api.path.exists(api.path['checkout'].join('buildtools').join('reclient')),
)
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.*'),
)
yield api.test(
'fail',
api.step_data('build it', retcode=1),
status='FAILURE',
)
yield api.test(
'timeout',
api.step_data('build it', times_out_after=60 * 61 + 1),
status='FAILURE',
)
yield api.test(
'custom-timeout',
api.properties(**{'$dart/build': Build(timeout=1234)}),
api.post_process(post_process.Filter('build it')),
)