5PYTHON_VERSION_COMPATIBILITY =
"PY3"
8 'recipe_engine/context',
10 'recipe_engine/platform',
11 'recipe_engine/properties',
19 api.run(api.step,
'run %d' % i, cmd=[
'echo', str(i)])
25 api.run(api.step,
'fail', cmd=[
'false'])
26 except api.step.StepFailure:
28 api.run(api.step,
'fail again', cmd=[
'false'], abort_on_failure=
False)
29 api.run(api.step,
'do a thing', cmd=[
'echo',
'do the thing'])
30 assert len(api.run.failed_steps) == 2
34 api.run.run_once(myfunc, api, i)
37 api.run.readfile(
'myfile.txt')
38 api.run.writefile(
'myfile.txt',
'contents')
39 api.run.rmtree(
'mydir')
40 api.run.asset_version(
'my_asset', api.vars.cache_dir.join(
'work',
'skia'))
43 with api.context(env={
'PATH':
'mydir:%(PATH)s'}):
44 api.run(api.step,
'env', cmd=[
'env'])
46 def between_attempts_fn(attempt):
47 api.run(api.step,
'between_attempts #%d' % attempt,
48 cmd=[
'echo',
'between_attempt'])
52 api.run.with_retry(api.step,
'retry fail', 5, cmd=[
'false'],
53 between_attempts_fn=between_attempts_fn)
54 except api.step.StepFailure:
56 assert len(api.run.failed_steps) == 7
58 api.run.with_retry(api.step,
'retry success', 3, cmd=[
'false'],
59 between_attempts_fn=between_attempts_fn)
60 assert len(api.run.failed_steps) == 7
63 api.run.check_failure()
67 buildername =
'Build-Win-Clang-x86_64-Release-Vulkan'
70 api.properties(buildername=buildername,
71 repository=
'https://skia.googlesource.com/skia.git',
73 path_config=
'kitchen',
74 swarm_out_dir=
'[SWARM_OUT_DIR]') +
75 api.platform(
'win', 64) +
76 api.step_data(
'fail', retcode=1) +
77 api.step_data(
'fail again', retcode=1) +
78 api.step_data(
'retry fail', retcode=1) +
79 api.step_data(
'retry fail (attempt 2)', retcode=1) +
80 api.step_data(
'retry fail (attempt 3)', retcode=1) +
81 api.step_data(
'retry fail (attempt 4)', retcode=1) +
82 api.step_data(
'retry fail (attempt 5)', retcode=1) +
83 api.step_data(
'retry success', retcode=1) +
84 api.step_data(
'retry success (attempt 2)', retcode=1)