Generate tests with the real names (#26427)

Generates performance tests with real names instead of uuids. This allows test names to be up to 253 characters long, which is now supported by the framework.
pull/26477/head
Donghao Qiu 4 years ago committed by GitHub
parent cbc6f0b0f8
commit 2d8546a3c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      tools/run_tests/performance/loadtest_config.py

@ -63,9 +63,9 @@ def now_string() -> str:
def validate_loadtest_name(name: str) -> None:
"""Validates that a LoadTest name is in the expected format."""
if len(name) > 63:
if len(name) > 253:
raise ValueError(
'LoadTest name must be less than 63 characters long: %s' % name)
'LoadTest name must be less than 253 characters long: %s' % name)
if not all((s.isalnum() for s in name.split('-'))):
raise ValueError('Invalid elements in LoadTest name: %s' % name)
@ -85,7 +85,7 @@ def loadtest_name(prefix: str, scenario_name: str,
name_elements = []
if prefix:
name_elements.append(prefix)
name_elements.append(str(uuid.uuid5(uuid.NAMESPACE_DNS, base_name)))
name_elements.append(base_name)
name = '-'.join(name_elements)
validate_loadtest_name(name)
return name

Loading…
Cancel
Save