Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Namespaces | Functions | Variables
infra Namespace Reference

Namespaces

namespace  api
 

Functions

 git_init (api, repo_root, env)
 
 RunSteps (api)
 
 GenTests (api)
 

Variables

str PYTHON_VERSION_COMPATIBILITY = "PY3"
 
list DEPS
 

Function Documentation

◆ GenTests()

infra.GenTests (   api)

Definition at line 67 of file infra.py.

67def GenTests(api):
68 yield (
69 api.test('infra_tests') +
70 api.properties(buildername='Housekeeper-PerCommit-InfraTests_Linux',
71 repository='https://skia.googlesource.com/skia.git',
72 path_config='kitchen',
73 swarm_out_dir='[SWARM_OUT_DIR]')
74 )
75 yield (
76 api.test('infra_tests_lottie_ci') +
77 api.properties(buildername='Housekeeper-PerCommit-InfraTests_Linux',
78 repository='https://skia.googlesource.com/lottie-ci.git',
79 path_config='kitchen',
80 swarm_out_dir='[SWARM_OUT_DIR]')
81 )

◆ git_init()

infra.git_init (   api,
  repo_root,
  env 
)

Definition at line 20 of file infra.py.

20def git_init(api, repo_root, env):
21 with api.context(cwd=repo_root, env=env):
22 # Some tests assume that they're being run inside a git repo.
23 api.step('git init', cmd=['git', 'init'])
24 api.step('git add .', cmd=['git', 'add', '.'])
25 api.step('git commit', cmd=['git', 'commit', '-a', '-m', 'initial commit'])
26
27

◆ RunSteps()

infra.RunSteps (   api)

Definition at line 28 of file infra.py.

28def RunSteps(api):
29 api.vars.setup()
30
31 # Run the infra tests.
32 repo_name = api.properties['repository'].split('/')[-1]
33 if repo_name.endswith('.git'):
34 repo_name = repo_name[:-len('.git')]
35 repo_root = api.path['start_dir'].join(repo_name)
36 infra_tests = repo_root.join('infra', 'bots', 'infra_tests.py')
37
38 # Merge the default environment with the Go environment.
39 env = {}
40 env.update(api.infra.go_env)
41 for k, v in api.vars.default_env.items():
42 # The PATH variable gets merged; all others get replaced.
43 if k == 'PATH':
44 # This works because the value for PATH in go_env and default_env includes
45 # the '%(PATH)s' placeholder.
46 env[k] = env[k] % {k: v}
47 else:
48 env[k] = v
49
50 git_init(api, repo_root, env)
51 if repo_name != 'skia':
52 git_init(api, api.path['start_dir'].join('skia'), env)
53
54 with api.context(cwd=repo_root, env=env):
55 # Unfortunately, the recipe tests are flaky due to file removal on Windows.
56 # Run multiple attempts.
57 last_exc = None
58 for _ in range(3):
59 try:
60 api.step('infra_tests', cmd=['python3', '-u', infra_tests])
61 break
62 except api.step.StepFailure as e: # pragma: nocover
63 last_exc = e
64 else: # pragma: nocover
65 raise last_exc
66

Variable Documentation

◆ DEPS

list infra.DEPS
Initial value:
1= [
2 'recipe_engine/context',
3 'recipe_engine/file',
4 'recipe_engine/path',
5 'recipe_engine/raw_io',
6 'recipe_engine/step',
7 'run',
8 'vars',
9]

Definition at line 7 of file __init__.py.

◆ PYTHON_VERSION_COMPATIBILITY

str infra.PYTHON_VERSION_COMPATIBILITY = "PY3"

Definition at line 5 of file __init__.py.