diff options
author | 2018-04-17 14:11:23 -0400 | |
---|---|---|
committer | 2018-04-17 18:56:24 +0000 | |
commit | 8ff86a6f38ceff715d5f11dcffc3fb7b1c97eb62 (patch) | |
tree | 03c23c6d769a9161894f8676cf7e10ef9810ab50 /infra/bots/recipe_modules/builder_name_schema/examples | |
parent | d2d367d1724d87db610fb15c31fb4d6b5e2db970 (diff) |
[infra] Support recursive configs in builder_name_schema
This fixes problems with Upload- tasks which just prefix other types of
task names.
Bug: skia:
Change-Id: Icdbcfc5a889e821c6923f635eae0744c3cb0133c
Reviewed-on: https://skia-review.googlesource.com/121786
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
Diffstat (limited to 'infra/bots/recipe_modules/builder_name_schema/examples')
-rw-r--r-- | infra/bots/recipe_modules/builder_name_schema/examples/full.py | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/infra/bots/recipe_modules/builder_name_schema/examples/full.py b/infra/bots/recipe_modules/builder_name_schema/examples/full.py index 5e5f77ffcb..f8eade8bcb 100644 --- a/infra/bots/recipe_modules/builder_name_schema/examples/full.py +++ b/infra/bots/recipe_modules/builder_name_schema/examples/full.py @@ -9,20 +9,23 @@ DEPS = [ def RunSteps(api): - name = 'Build-Debian9-Clang-x64-Release-Android' - d = api.builder_name_schema.DictForBuilderName(name) - got = api.builder_name_schema.MakeBuilderName(**d) - assert got == name + names = [ + 'Build-Debian9-Clang-x64-Release-Android', + 'Upload-Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-Shard_12-Coverage', + ] + for name in names: + d = api.builder_name_schema.DictForBuilderName(name) + got = api.builder_name_schema.MakeBuilderName(**d) + assert got == name # Failures. try: - api.builder_name_schema.MakeBuilderName('nope') + api.builder_name_schema.MakeBuilderName(role='nope') except ValueError: pass try: - api.builder_name_schema.MakeBuilderName( - role='Build', os='a%sb' % api.builder_name_schema.BUILDER_NAME_SEP) + api.builder_name_schema.MakeBuilderName(compiler='Build', os='ab') except ValueError: pass @@ -59,6 +62,32 @@ def RunSteps(api): except ValueError: pass + try: + api.builder_name_schema.MakeBuilderName(role='Upload') + except ValueError: + pass + + try: + m = { + 'role': 'Upload', + 'sub-role-1': 'fake', + } + api.builder_name_schema.MakeBuilderName(**m) + except ValueError: + pass + + try: + api.builder_name_schema.MakeBuilderName( + role='Build', + os='Debian9', + compiler='Clang', + target_arch='x64', + configuration='Release', + extra_config='Android', + extra_extra_config='Bogus', + ) + except ValueError: + pass def GenTests(api): yield api.test('test') |