Lines Matching full:api
35 def RunSteps(api): argument
36 api.vars.setup()
38 checkout_root = api.checkout.default_checkout_root
39 api.checkout.bot_update(checkout_root=checkout_root)
41 out_dir = api.vars.swarming_out_dir
43 bin_dir = api.vars.build_dir
45 api.file.ensure_directory('mkdirs out_dir', out_dir, mode=0o777)
48 with api.context(cwd=bin_dir):
49 files = api.file.glob_paths(
56 analyze_wasm_file(api, checkout_root, out_dir, files)
58 files = api.file.glob_paths(
65 analyze_web_file(api, checkout_root, out_dir, files)
67 files = api.file.glob_paths(
74 analyze_web_file(api, checkout_root, out_dir, files)
76 files = api.file.glob_paths(
83 analyze_flutter_lib(api, checkout_root, out_dir, files)
85 files = api.file.glob_paths(
92 analyze_cpp_lib(api, checkout_root, out_dir, files)
94 files = api.file.glob_paths(
101 make_treemap(api, checkout_root, out_dir, files)
103 files = api.file.glob_paths(
110 make_treemap(api, checkout_root, out_dir, files)
116 def keys_and_props(api): argument
118 for k in sorted(api.vars.builder_cfg.keys()):
120 keys.extend([k, api.vars.builder_cfg[k]])
124 'gitHash', api.properties['revision'],
125 'swarming_bot_id', api.vars.swarming_bot_id,
126 'swarming_task_id', api.vars.swarming_task_id,
129 if api.vars.is_trybot:
131 'issue', api.vars.issue,
132 'patchset', api.vars.patchset,
133 'patch_storage', api.vars.patch_storage,
140 def analyze_web_file(api, checkout_root, out_dir, files): argument
141 (keystr, propstr) = keys_and_props(api)
145 with api.context(cwd=skia_dir):
148 step_data = api.run(api.python, 'Analyze %s' % f, script=script,
151 stdout=api.raw_io.output())
154 result = api.step.active_result
158 add_binary_size_output_property(result, api.path.basename(f), (
161 .get(api.path.basename(f), {})
167 def analyze_cpp_lib(api, checkout_root, out_dir, files): argument
168 (keystr, propstr) = keys_and_props(api)
169 bloaty_exe = api.path['start_dir'].join('bloaty', 'bloaty')
173 with api.context(cwd=skia_dir):
176 step_data = api.run(api.python, 'Analyze %s' % f, script=script,
179 stdout=api.raw_io.output())
182 result = api.step.active_result
186 add_binary_size_output_property(result, api.path.basename(f), (
189 .get(api.path.basename(f), {})
195 def analyze_flutter_lib(api, checkout_root, out_dir, files): argument
196 (keystr, propstr) = keys_and_props(api)
197 bloaty_exe = api.path['start_dir'].join('bloaty', 'bloaty')
202 with api.context(cwd=skia_dir):
203 stripped = api.vars.build_dir.join('libflutter_stripped.so')
208 step_data = api.run(api.python, 'Analyze flutter', script=script,
212 stdout=api.raw_io.output())
215 result = api.step.active_result
234 def analyze_wasm_file(api, checkout_root, out_dir, files): argument
235 (keystr, propstr) = keys_and_props(api)
236 bloaty_exe = api.path['start_dir'].join('bloaty', 'bloaty')
241 with api.context(cwd=skia_dir):
244 step_data = api.run(api.python, 'Analyze wasm', script=script,
247 stdout=api.raw_io.output())
250 result = api.step.active_result
257 add_binary_size_output_property(result, api.path.basename(f), (
260 .get(api.path.basename(f), {})
266 def make_treemap(api, checkout_root, out_dir, files): argument
269 with api.env(env):
271 with api.context(cwd=skia_dir):
274 api.run(api.python, 'Make code size treemap %s' % f,
277 stdout=api.raw_io.output())
280 def GenTests(api): argument
283 api.test('normal_bot') +
284 api.properties(buildername=builder,
289 api.step_data('get swarming bot id',
290 stdout=api.raw_io.output('skia-bot-123')) +
291 api.step_data('get swarming task id',
292 stdout=api.raw_io.output('123456abc')) +
293 api.step_data('Analyze [START_DIR]/build/pathkit.js.mem',
294 stdout=api.raw_io.output(sample_web)) +
295 api.step_data('Analyze [START_DIR]/build/libskia.so',
296 stdout=api.raw_io.output(sample_cpp)) +
297 api.step_data('Analyze wasm',
298 stdout=api.raw_io.output(sample_wasm)) +
299 api.step_data('Analyze flutter',
300 stdout=api.raw_io.output(sample_flutter))
304 api.test('trybot') +
305 api.properties(buildername=builder,
311 api.step_data('get swarming bot id',
312 stdout=api.raw_io.output('skia-bot-123')) +
313 api.step_data('get swarming task id',
314 stdout=api.raw_io.output('123456abc')) +
315 api.properties(patch_storage='gerrit') +
316 api.properties.tryserver(
321 api.step_data('Analyze [START_DIR]/build/pathkit.js.mem',
322 stdout=api.raw_io.output(sample_web)) +
323 api.step_data('Analyze [START_DIR]/build/libskia.so',
324 stdout=api.raw_io.output(sample_cpp)) +
325 api.step_data('Analyze wasm',
326 stdout=api.raw_io.output(sample_wasm)) +
327 api.step_data('Analyze flutter',
328 stdout=api.raw_io.output(sample_flutter))