28 api.vars.setup()
29 checkout_root = api.path.start_dir
30 out_dir = api.vars.swarming_out_dir
31
32
33 api.file.ensure_directory('mkdirs out_dir', out_dir, mode=0o777)
34
35
36
37 copy_dest = checkout_root.join('skia', 'modules', 'pathkit',
38 'npm-wasm', 'bin')
39 if 'asmjs' in api.vars.builder_name:
40 copy_dest = checkout_root.join('skia', 'modules', 'pathkit',
41 'npm-asmjs', 'bin')
42
43 base_dir = api.vars.build_dir
44 bundle_name = 'pathkit.wasm'
45 if 'asmjs' in api.vars.builder_name:
46 bundle_name = 'pathkit.js.mem'
47
48 copies = [
49 {
50 'src': base_dir.join('pathkit.js'),
51 'dst': copy_dest.join('pathkit.js'),
52 },
53 {
54 'src': base_dir.join(bundle_name),
55 'dst': copy_dest.join(bundle_name),
56 },
57 ]
58 recursive_read = [checkout_root.join('skia')]
59
60 docker_args = None
61 if 'asmjs' in api.vars.builder_name:
62 docker_args = ['--env', 'ASM_JS=1']
63
64 args = [
65 '--builder', api.vars.builder_name,
66 '--git_hash', api.properties['revision'],
67 '--buildbucket_build_id', api.properties.get('buildbucket_build_id', ''),
68 '--bot_id', api.vars.swarming_bot_id,
69 '--task_id', api.vars.swarming_task_id,
70 '--browser', 'Chrome',
71 '--config', api.vars.configuration,
72 '--source_type', 'pathkit',
73 ]
74 if 'asmjs' in api.vars.builder_name:
75 args.extend(['--compiled_language', 'asmjs'])
76 if api.vars.is_trybot:
77 args.extend([
78 '--issue', api.vars.issue,
79 '--patchset', api.vars.patchset,
80 ])
81
82 api.docker.run(
83 name='Performance tests of PathKit with Docker',
84 docker_image=DOCKER_IMAGE,
85 src_dir=checkout_root,
86 out_dir=out_dir,
87 script=checkout_root.join(INNER_KARMA_SCRIPT),
88 args=args,
89 docker_args=docker_args,
90 copies=copies,
91 recursive_read=recursive_read,
92 attempts=3,
93 )
94
95