Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
vars.api.SkiaVarsApi Class Reference
Inheritance diagram for vars.api.SkiaVarsApi:

Public Member Functions

def setup (self)
 
def is_linux (self)
 
def swarming_bot_id (self)
 
def swarming_task_id (self)
 

Public Attributes

 builder_name
 
 workdir
 
 build_dir
 
 default_env
 
 cache_dir
 
 swarming_out_dir
 
 tmp_dir
 
 builder_cfg
 
 role
 
 configuration
 
 extra_tokens
 
 patch_storage
 
 issue
 
 patchset
 
 is_trybot
 
 internal_hardware_label
 
 is_internal_bot
 

Detailed Description

Definition at line 16 of file api.py.

Member Function Documentation

◆ is_linux()

def vars.api.SkiaVarsApi.is_linux (   self)

Definition at line 88 of file api.py.

88 def is_linux(self):
89 return (
90 'Ubuntu' in self.builder_name
91 or 'Debian' in self.builder_name
92 or 'Housekeeper' in self.builder_name
93 )
94
def is_linux()
Definition: run_tests.py:147

◆ setup()

def vars.api.SkiaVarsApi.setup (   self)
Prepare the variables.

Definition at line 18 of file api.py.

18 def setup(self):
19 """Prepare the variables."""
20 # Hack start_dir to remove the "k" directory which is added by Kitchen.
21 # Otherwise, we can't get to the CIPD packages, caches, and isolates which
22 # were put into the task workdir.
23 if self.m.path.basename(self.m.path.start_dir) == 'k': # pragma: nocover
24 self.m.path._start_dir = self.m.path._start_dir[:-2]
25
26 # Setup
27 self.builder_name = self.m.properties['buildername']
28
29 self.workdir = self.m.path.start_dir
30
31 # Special input/output directories.
32 self.build_dir = self.workdir.join('build')
33
34 self.default_env = self.m.context.env
35 self.default_env['CHROME_HEADLESS'] = '1'
36 self.default_env['PATH'] = self.m.path.pathsep.join([
37 self.default_env.get('PATH', '%(PATH)s'),
38 str(self.m.bot_update.repo_resource()),
39 ])
40 self.cache_dir = self.workdir.join('cache')
41
42 self.swarming_out_dir = self.workdir.join(
43 self.m.properties.get('swarm_out_dir', 'tmp'))
44
45 self.tmp_dir = self.m.path.start_dir.join('tmp')
46
47 self.builder_cfg = self.m.builder_name_schema.DictForBuilderName(
48 self.builder_name)
49 self.role = self.builder_cfg['role']
50 if self.role == self.m.builder_name_schema.BUILDER_ROLE_HOUSEKEEPER:
51 self.configuration = CONFIG_RELEASE
52 else:
53 self.configuration = self.builder_cfg.get('configuration', CONFIG_DEBUG)
54 arch = (self.builder_cfg.get('arch') or self.builder_cfg.get('target_arch'))
55 if ('Win' in self.builder_cfg.get('os', '') and arch == 'x86_64'):
56 self.configuration += '_x64'
57
58 self.extra_tokens = []
59 if len(self.builder_cfg.get('extra_config', '')) > 0:
60 if self.builder_cfg['extra_config'].startswith('SK'):
61 assert self.builder_cfg['extra_config'].isupper()
62 self.extra_tokens = [self.builder_cfg['extra_config']]
63 else:
64 self.extra_tokens = self.builder_cfg['extra_config'].split('_')
65
66 self.patch_storage = self.m.properties.get('patch_storage', 'gerrit')
67 self.issue = None
68 self.patchset = None
69 self.is_trybot = False
70 if (self.m.properties.get('patch_issue', '') and
71 self.m.properties['patch_issue'] != '0' and
72 self.m.properties.get('patch_set', '') and
73 self.m.properties['patch_set'] != '0' and
74 self.m.properties.get('patch_ref', '')):
75 self.is_trybot = True
76 self.issue = self.m.properties['patch_issue']
77 self.patchset = self.m.properties['patch_set']
78
79 self._swarming_bot_id = None
80 self._swarming_task_id = None
81
82 # Internal bot support.
83 self.internal_hardware_label = (
84 self.m.properties.get('internal_hardware_label'))
85 self.is_internal_bot = self.internal_hardware_label is not None
86
const myers::Point & get(const myers::Segment &)
static SkString join(const CommandLineFlags::StringArray &)
Definition: skpbench.cpp:741
static void setup(SkCanvas *canvas, SkPaint *paint, const SkBitmap &bm, SkFilterMode fm, SkTileMode tmx, SkTileMode tmy)
Definition: tilemodes.cpp:52

◆ swarming_bot_id()

def vars.api.SkiaVarsApi.swarming_bot_id (   self)

Definition at line 96 of file api.py.

96 def swarming_bot_id(self):
97 if not self._swarming_bot_id:
98 script = self.resource('get_env_var.py')
99 step_stdout = self.m.step(
100 name='get swarming bot id',
101 cmd=['python3', script, 'SWARMING_BOT_ID'],
102 stdout=self.m.raw_io.output()).stdout.decode('utf-8')
103 self._swarming_bot_id = step_stdout.rstrip() if step_stdout else ''
104 return self._swarming_bot_id
105
static int step(int x, SkScalar min, SkScalar max)
Definition: BlurTest.cpp:215

◆ swarming_task_id()

def vars.api.SkiaVarsApi.swarming_task_id (   self)

Definition at line 107 of file api.py.

107 def swarming_task_id(self):
108 if not self._swarming_task_id:
109 script = self.resource('get_env_var.py')
110 step_stdout = self.m.step(
111 name='get swarming task id',
112 cmd=['python3', script, 'SWARMING_TASK_ID'],
113 stdout=self.m.raw_io.output()).stdout.decode('utf-8')
114 self._swarming_task_id = step_stdout.rstrip() if step_stdout else ''
115 return self._swarming_task_id

Member Data Documentation

◆ build_dir

vars.api.SkiaVarsApi.build_dir

Definition at line 32 of file api.py.

◆ builder_cfg

vars.api.SkiaVarsApi.builder_cfg

Definition at line 47 of file api.py.

◆ builder_name

vars.api.SkiaVarsApi.builder_name

Definition at line 27 of file api.py.

◆ cache_dir

vars.api.SkiaVarsApi.cache_dir

Definition at line 40 of file api.py.

◆ configuration

vars.api.SkiaVarsApi.configuration

Definition at line 51 of file api.py.

◆ default_env

vars.api.SkiaVarsApi.default_env

Definition at line 34 of file api.py.

◆ extra_tokens

vars.api.SkiaVarsApi.extra_tokens

Definition at line 58 of file api.py.

◆ internal_hardware_label

vars.api.SkiaVarsApi.internal_hardware_label

Definition at line 83 of file api.py.

◆ is_internal_bot

vars.api.SkiaVarsApi.is_internal_bot

Definition at line 85 of file api.py.

◆ is_trybot

vars.api.SkiaVarsApi.is_trybot

Definition at line 69 of file api.py.

◆ issue

vars.api.SkiaVarsApi.issue

Definition at line 67 of file api.py.

◆ patch_storage

vars.api.SkiaVarsApi.patch_storage

Definition at line 66 of file api.py.

◆ patchset

vars.api.SkiaVarsApi.patchset

Definition at line 68 of file api.py.

◆ role

vars.api.SkiaVarsApi.role

Definition at line 49 of file api.py.

◆ swarming_out_dir

vars.api.SkiaVarsApi.swarming_out_dir

Definition at line 42 of file api.py.

◆ tmp_dir

vars.api.SkiaVarsApi.tmp_dir

Definition at line 45 of file api.py.

◆ workdir

vars.api.SkiaVarsApi.workdir

Definition at line 29 of file api.py.


The documentation for this class was generated from the following file: