29 api.vars.setup()
30
31
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
39 env = {}
40 env.update(api.infra.go_env)
41 for k, v in api.vars.default_env.items():
42
43 if k == 'PATH':
44
45
46 env[k] = env[k] % {k: v}
47 else:
48 env[k] = v
49
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
56
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:
63 last_exc = e
64 else:
65 raise last_exc
66