Lines Matching refs:api
21 def RunSteps(api): argument
22 api.vars.setup()
24 checkout_root = api.checkout.default_checkout_root
25 api.checkout.bot_update(checkout_root=checkout_root)
27 out_dir = api.vars.swarming_out_dir
29 bin_dir = api.vars.build_dir
31 api.file.ensure_directory('mkdirs out_dir', out_dir, mode=0777)
34 with api.context(cwd=bin_dir):
35 files = api.file.glob_paths(
42 analyze_wasm_file(api, checkout_root, out_dir, files)
44 files = api.file.glob_paths(
51 analyze_web_file(api, checkout_root, out_dir, files)
53 files = api.file.glob_paths(
60 analyze_web_file(api, checkout_root, out_dir, files)
62 files = api.file.glob_paths(
69 analyze_flutter_lib(api, checkout_root, out_dir, files)
71 files = api.file.glob_paths(
78 analyze_cpp_lib(api, checkout_root, out_dir, files)
80 files = api.file.glob_paths(
87 make_treemap(api, checkout_root, out_dir, files)
93 def keys_and_props(api): argument
96 for k in sorted(api.vars.builder_cfg.keys()):
98 keys.extend([k, api.vars.builder_cfg[k]])
102 'gitHash', api.properties['revision'],
103 'swarming_bot_id', api.vars.swarming_bot_id,
104 'swarming_task_id', api.vars.swarming_task_id,
107 if api.vars.is_trybot:
109 'issue', str(api.vars.issue),
110 'patchset', str(api.vars.patchset),
111 'patch_storage', api.vars.patch_storage,
118 def analyze_web_file(api, checkout_root, out_dir, files): argument
119 (keystr, propstr) = keys_and_props(api)
123 with api.context(cwd=skia_dir):
126 api.run(api.python, 'Analyze %s' % f, script=script,
131 def analyze_cpp_lib(api, checkout_root, out_dir, files): argument
132 (keystr, propstr) = keys_and_props(api)
133 bloaty_exe = api.path['start_dir'].join('bloaty', 'bloaty')
137 with api.context(cwd=skia_dir):
140 api.run(api.python, 'Analyze %s' % f, script=script,
145 def analyze_flutter_lib(api, checkout_root, out_dir, files): argument
146 (keystr, propstr) = keys_and_props(api)
147 bloaty_exe = api.path['start_dir'].join('bloaty', 'bloaty')
152 with api.context(cwd=skia_dir):
153 stripped = api.vars.build_dir.join('libflutter_stripped.so')
156 step_data = api.run(api.python, 'Analyze flutter', script=script,
159 stdout=api.raw_io.output())
163 result = api.step.active_result
175 def analyze_wasm_file(api, checkout_root, out_dir, files): argument
176 (keystr, propstr) = keys_and_props(api)
177 bloaty_exe = api.path['start_dir'].join('bloaty', 'bloaty')
182 with api.context(cwd=skia_dir):
185 step_data = api.run(api.python, 'Analyze wasm', script=script,
187 stdout=api.raw_io.output())
191 result = api.step.active_result
201 def make_treemap(api, checkout_root, out_dir, files): argument
204 with api.env(env):
206 with api.context(cwd=skia_dir):
209 api.run(api.python, 'Make code size treemap',
212 stdout=api.raw_io.output())
215 def GenTests(api): argument
218 api.test('normal_bot') +
219 api.properties(buildername=builder,
224 api.step_data('get swarming bot id',
225 stdout=api.raw_io.output('skia-bot-123')) +
226 api.step_data('get swarming task id',
227 stdout=api.raw_io.output('123456abc')) +
228 api.step_data('Analyze wasm',
229 stdout=api.raw_io.output(sample_wasm)) +
230 api.step_data('Analyze flutter',
231 stdout=api.raw_io.output(sample_flutter))
235 api.test('trybot') +
236 api.properties(buildername=builder,
242 api.step_data('get swarming bot id',
243 stdout=api.raw_io.output('skia-bot-123')) +
244 api.step_data('get swarming task id',
245 stdout=api.raw_io.output('123456abc')) +
246 api.properties(patch_storage='gerrit') +
247 api.properties.tryserver(
252 api.step_data('Analyze wasm',
253 stdout=api.raw_io.output(sample_wasm)) +
254 api.step_data('Analyze flutter',
255 stdout=api.raw_io.output(sample_flutter))