[infra] Rename internal_bot_id -> internal_hardware_label

Bug: skia:
Change-Id: I1a2442898c8eca8cf36d8e85d2acf1d048ebfb54
Reviewed-on: https://skia-review.googlesource.com/46849
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
This commit is contained in:
Eric Boren 2017-09-15 10:35:44 -04:00 committed by Skia Commit-Bot
parent a32c47b0e2
commit fd4d60eac0
3 changed files with 16 additions and 15 deletions

View File

@ -60,9 +60,9 @@ var (
// dimensions for the given task.
alternateSwarmDimensions func(parts map[string]string) []string
// internalBotIdFn can be set in an init function to provide an
// internal_bot_id variable to the recipe.
internalBotIdFn func(parts map[string]string) *string
// internalHardwareLabelFn can be set in an init function to provide an
// internal_hardware_label variable to the recipe.
internalHardwareLabelFn func(parts map[string]string) *string
// Defines the structure of job names.
jobNameSchema *JobNameSchema
@ -86,10 +86,10 @@ var (
jobsFile = flag.String("jobs", "", "JSON file containing jobs to run.")
)
// internalBotId returns the internal ID for the bot, if any.
func internalBotId(parts map[string]string) *string {
if internalBotIdFn != nil {
return internalBotIdFn(parts)
// internalHardwareLabel returns the internal ID for the bot, if any.
func internalHardwareLabel(parts map[string]string) *string {
if internalHardwareLabelFn != nil {
return internalHardwareLabelFn(parts)
}
return nil
}
@ -726,9 +726,9 @@ func test(b *specs.TasksCfgBuilder, name string, parts map[string]string, compil
// skia:6737
s.ExecutionTimeout = 6 * time.Hour
}
iid := internalBotId(parts)
iid := internalHardwareLabel(parts)
if iid != nil {
s.ExtraArgs = append(s.ExtraArgs, fmt.Sprintf("internal_bot_id=%s", *iid))
s.ExtraArgs = append(s.ExtraArgs, fmt.Sprintf("internal_hardware_label=%s", *iid))
}
b.MustAddTask(name, s)
@ -820,9 +820,9 @@ func perf(b *specs.TasksCfgBuilder, name string, parts map[string]string, compil
// skia:6737
s.ExecutionTimeout = 6 * time.Hour
}
iid := internalBotId(parts)
iid := internalHardwareLabel(parts)
if iid != nil {
s.ExtraArgs = append(s.ExtraArgs, fmt.Sprintf("internal_bot_id=%s", *iid))
s.ExtraArgs = append(s.ExtraArgs, fmt.Sprintf("internal_hardware_label=%s", *iid))
}
b.MustAddTask(name, s)

View File

@ -144,8 +144,9 @@ class SkiaVarsApi(recipe_api.RecipeApi):
self.chromeos_homedir = '/home/chronos/user/'
# Internal bot support.
self.internal_bot_id = self.m.properties.get('internal_bot_id')
self.is_internal_bot = self.internal_bot_id is not None
self.internal_hardware_label = (
self.m.properties.get('internal_hardware_label'))
self.is_internal_bot = self.internal_hardware_label is not None
@property
def is_linux(self):

View File

@ -233,7 +233,7 @@ def dm_flags(api, bot):
args.extend(['--pr', 'ccpr'])
# Bogus test for internal bot.
if api.vars.internal_bot_id == '0':
if api.vars.internal_hardware_label == '0':
args.append('--internal0')
args.append('--config')
@ -1096,7 +1096,7 @@ def GenTests(api):
revision='abc123',
path_config='kitchen',
swarm_out_dir='[SWARM_OUT_DIR]',
internal_bot_id='0') +
internal_hardware_label='0') +
api.path.exists(
api.path['start_dir'].join('skia'),
api.path['start_dir'].join('skia', 'infra', 'bots', 'assets',