9"""Run all infrastructure-related tests."""
17INFRA_BOTS_DIR = os.path.dirname(os.path.realpath(__file__))
18SKIA_DIR = os.path.abspath(os.path.join(INFRA_BOTS_DIR, os.pardir, os.pardir))
23 subprocess.check_output(cmd, cwd=cwd, stderr=subprocess.STDOUT, encoding=
'utf-8')
24 except subprocess.CalledProcessError
as e:
32 [sys.executable,
'-u',
'-m',
'unittest',
'discover',
'-s',
'.',
'-p',
39 sys.executable,
'-u', os.path.join(INFRA_BOTS_DIR,
'recipes.py'),
'test']
44 return test(cmd, SKIA_DIR)
48 cmd = [
'go',
'run',
'gen_tasks.go']
52 output =
test(cmd, INFRA_BOTS_DIR)
54 return (
'Failed to run "%s"; do you have Go installed on your machine?'
61 if '--train' in sys.argv:
76 print(
'Test failures:\n', file=sys.stderr)
78 print(
'==============================', file=sys.stderr)
79 print(err, file=sys.stderr)
80 print(
'==============================', file=sys.stderr)
84 print(
'Trained tests successfully.')
86 print(
'All tests passed!')
89if __name__ ==
'__main__':
def gen_tasks_test(train)
def python_unit_tests(train)
def print(*args, **kwargs)
static SkString join(const CommandLineFlags::StringArray &)