Classes | Functions | Variables
run_tests Namespace Reference

Classes

class  BuildAndRunError
 
class  CLanguage
 
class  Config
 
class  CSharpLanguage
 
class  ObjCLanguage
 
class  Php7Language
 
class  PythonConfig
 
class  PythonLanguage
 
class  RemoteNodeLanguage
 
class  RubyLanguage
 
class  Sanity
 

Functions

def _build_and_run (check_cancelled, newline_on_success, xml_report=None, build_only=False)
 
def _build_step_environ (cfg, extra_env={})
 
def _calculate_num_runs_failures (list_of_results)
 
def _check_arch (arch, supported_archs)
 
def _check_arch_option (arch)
 
def _check_compiler (compiler, supported_compilers)
 
def _docker_arch_suffix (arch)
 
def _is_use_docker_child ()
 
def _print_debug_info_epilogue (dockerfile_dir=None)
 
def _pypy_config_generator (name, major, config_vars)
 
def _pypy_pattern_function (major)
 
def _python_config_generator (name, major, minor, bits, config_vars)
 
def _python_pattern_function (major, minor, bits)
 
def _shut_down_legacy_server (legacy_server_port)
 
def _windows_arch_option (arch)
 
def get_c_tests (travis, test_lang)
 
def isclose (a, b, rel_tol=1e-09, abs_tol=0.0)
 
def max_parallel_tests_for_current_platform ()
 
def percent_type (arg_str)
 
def platform_string ()
 
def run_shell_command (cmd, env=None, cwd=None)
 
def runs_per_test_type (arg_str)
 

Variables

 _CONFIGS
 
int _DEFAULT_TIMEOUT_SECONDS = 5 * 60
 
dictionary _FORCE_ENVIRON_FOR_WRAPPERS
 
dictionary _LANGUAGES
 
dictionary _MSBUILD_CONFIG
 
dictionary _POLLING_STRATEGIES
 
int _PRE_BUILD_STEP_TIMEOUT_SECONDS = 10 * 60
 
 _PythonConfigVars
 
 _ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..'))
 
 action
 
 argp = argparse.ArgumentParser(description='Run grpc tests.')
 
 args = argp.parse_args()
 
 build_config = run_config.build_config
 
 build_steps
 
list child_argv = [arg for arg in sys.argv if not arg == '--use_docker']
 
 choices
 
 const
 
 default
 
 do_newline
 
 dockerfile_dir = next(iter(dockerfile_dirs))
 
 dockerfile_dirs = set([l.dockerfile_dir() for l in languages])
 
 env = os.environ.copy()
 
def errors
 
int exit_code = 0
 
 flaky_tests = set()
 
 gcp_utils_dir
 
 help
 
 languages = set(_LANGUAGES[l] for l in args.language)
 
 measure_cpu_costs
 
 nargs
 
 post_tests_steps
 
 required
 
 retcode
 
 run_config = _CONFIGS[args.config]
 
string run_tests_cmd
 
 runs_per_test = args.runs_per_test
 
dictionary shortname_to_cpu = {}
 
 type
 

Function Documentation

◆ _build_and_run()

def run_tests._build_and_run (   check_cancelled,
  newline_on_success,
  xml_report = None,
  build_only = False 
)
private
Do one pass of building & running tests.

Definition at line 1298 of file run_tests.py.

◆ _build_step_environ()

def run_tests._build_step_environ (   cfg,
  extra_env = {} 
)
private
Environment variables set for each build step.

Definition at line 1160 of file run_tests.py.

◆ _calculate_num_runs_failures()

def run_tests._calculate_num_runs_failures (   list_of_results)
private
Calculate number of runs and failures for a particular test.

  Args:
list_of_results: (List) of JobResult object.
  Returns:
A tuple of total number of runs and failures.

Definition at line 1271 of file run_tests.py.

◆ _check_arch()

def run_tests._check_arch (   arch,
  supported_archs 
)
private

Definition at line 177 of file run_tests.py.

◆ _check_arch_option()

def run_tests._check_arch_option (   arch)
private
Checks that architecture option is valid.

Definition at line 1181 of file run_tests.py.

◆ _check_compiler()

def run_tests._check_compiler (   compiler,
  supported_compilers 
)
private

Definition at line 171 of file run_tests.py.

◆ _docker_arch_suffix()

def run_tests._docker_arch_suffix (   arch)
private
Returns suffix to dockerfile dir to use.

Definition at line 1209 of file run_tests.py.

◆ _is_use_docker_child()

def run_tests._is_use_docker_child ( )
private
Returns True if running running as a --use_docker child.

Definition at line 182 of file run_tests.py.

◆ _print_debug_info_epilogue()

def run_tests._print_debug_info_epilogue (   dockerfile_dir = None)
private
Use to print useful info for debug/repro just before exiting.

Definition at line 97 of file run_tests.py.

◆ _pypy_config_generator()

def run_tests._pypy_config_generator (   name,
  major,
  config_vars 
)
private

Definition at line 208 of file run_tests.py.

◆ _pypy_pattern_function()

def run_tests._pypy_pattern_function (   major)
private

Definition at line 232 of file run_tests.py.

◆ _python_config_generator()

def run_tests._python_config_generator (   name,
  major,
  minor,
  bits,
  config_vars 
)
private

Definition at line 197 of file run_tests.py.

◆ _python_pattern_function()

def run_tests._python_pattern_function (   major,
  minor,
  bits 
)
private

Definition at line 218 of file run_tests.py.

◆ _shut_down_legacy_server()

def run_tests._shut_down_legacy_server (   legacy_server_port)
private
Shut down legacy version of port server.

Definition at line 1257 of file run_tests.py.

◆ _windows_arch_option()

def run_tests._windows_arch_option (   arch)
private
Returns msbuild cmdline option for selected architecture.

Definition at line 1170 of file run_tests.py.

◆ get_c_tests()

def run_tests.get_c_tests (   travis,
  test_lang 
)

Definition at line 159 of file run_tests.py.

◆ isclose()

def run_tests.isclose (   a,
  b,
  rel_tol = 1e-09,
  abs_tol = 0.0 
)

Definition at line 1253 of file run_tests.py.

◆ max_parallel_tests_for_current_platform()

def run_tests.max_parallel_tests_for_current_platform ( )

Definition at line 89 of file run_tests.py.

◆ percent_type()

def run_tests.percent_type (   arg_str)

Definition at line 1244 of file run_tests.py.

◆ platform_string()

def run_tests.platform_string ( )

Definition at line 71 of file run_tests.py.

◆ run_shell_command()

def run_tests.run_shell_command (   cmd,
  env = None,
  cwd = None 
)

Definition at line 79 of file run_tests.py.

◆ runs_per_test_type()

def run_tests.runs_per_test_type (   arg_str)
Auxiliary function to parse the "runs_per_test" flag.

   Returns:
       A positive integer or 0, the latter indicating an infinite number of
       runs.

   Raises:
       argparse.ArgumentTypeError: Upon invalid input.

Definition at line 1222 of file run_tests.py.

Variable Documentation

◆ _CONFIGS

run_tests._CONFIGS
private
Initial value:
1 = dict(
2  (cfg['config'], Config(**cfg)) for cfg in ast.literal_eval(f.read()))

Definition at line 1138 of file run_tests.py.

◆ _DEFAULT_TIMEOUT_SECONDS

int run_tests._DEFAULT_TIMEOUT_SECONDS = 5 * 60
private

Definition at line 75 of file run_tests.py.

◆ _FORCE_ENVIRON_FOR_WRAPPERS

dictionary run_tests._FORCE_ENVIRON_FOR_WRAPPERS
private
Initial value:
1 = {
2  'GRPC_VERBOSITY': 'DEBUG',
3 }

Definition at line 61 of file run_tests.py.

◆ _LANGUAGES

dictionary run_tests._LANGUAGES
private
Initial value:
1 = {
2  'c++': CLanguage('cxx', 'c++'),
3  'c': CLanguage('c', 'c'),
4  'grpc-node': RemoteNodeLanguage(),
5  'php7': Php7Language(),
6  'python': PythonLanguage(),
7  'ruby': RubyLanguage(),
8  'csharp': CSharpLanguage(),
9  'objc': ObjCLanguage(),
10  'sanity': Sanity()
11 }

Definition at line 1141 of file run_tests.py.

◆ _MSBUILD_CONFIG

dictionary run_tests._MSBUILD_CONFIG
private
Initial value:
1 = {
2  'dbg': 'Debug',
3  'opt': 'Release',
4  'gcov': 'Debug',
5 }

Definition at line 1153 of file run_tests.py.

◆ _POLLING_STRATEGIES

dictionary run_tests._POLLING_STRATEGIES
private
Initial value:
1 = {
2  'linux': ['epoll1', 'poll'],
3  'mac': ['poll'],
4 }

Definition at line 65 of file run_tests.py.

◆ _PRE_BUILD_STEP_TIMEOUT_SECONDS

int run_tests._PRE_BUILD_STEP_TIMEOUT_SECONDS = 10 * 60
private

Definition at line 76 of file run_tests.py.

◆ _PythonConfigVars

run_tests._PythonConfigVars
private
Initial value:
1 = collections.namedtuple('_ConfigVars', [
2  'shell',
3  'builder',
4  'builder_prefix_arguments',
5  'venv_relative_python',
6  'toolchain',
7  'runner',
8 ])

Definition at line 187 of file run_tests.py.

◆ _ROOT

run_tests._ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..'))
private

Definition at line 58 of file run_tests.py.

◆ action

run_tests.action

Definition at line 1452 of file run_tests.py.

◆ argp

run_tests.argp = argparse.ArgumentParser(description='Run grpc tests.')

Definition at line 1427 of file run_tests.py.

◆ args

run_tests.args = argp.parse_args()

Definition at line 1587 of file run_tests.py.

◆ build_config

run_tests.build_config = run_config.build_config

Definition at line 1601 of file run_tests.py.

◆ build_steps

run_tests.build_steps
Initial value:
1 = list(
2  set(
3  jobset.JobSpec(cmdline,
4  environ=_build_step_environ(
5  build_config, extra_env=l.build_steps_environ()),
6  timeout_seconds=_PRE_BUILD_STEP_TIMEOUT_SECONDS,
7  flake_retries=2)
8  for l in languages
9  for cmdline in l.pre_build_steps()))

Definition at line 1657 of file run_tests.py.

◆ child_argv

list run_tests.child_argv = [arg for arg in sys.argv if not arg == '--use_docker']

Definition at line 1637 of file run_tests.py.

◆ choices

run_tests.choices

Definition at line 1430 of file run_tests.py.

◆ const

run_tests.const

Definition at line 1453 of file run_tests.py.

◆ default

run_tests.default

Definition at line 1431 of file run_tests.py.

◆ do_newline

run_tests.do_newline

Definition at line 1692 of file run_tests.py.

◆ dockerfile_dir

run_tests.dockerfile_dir = next(iter(dockerfile_dirs))

Definition at line 1635 of file run_tests.py.

◆ dockerfile_dirs

run_tests.dockerfile_dirs = set([l.dockerfile_dir() for l in languages])

Definition at line 1629 of file run_tests.py.

◆ env

run_tests.env = os.environ.copy()

Definition at line 1641 of file run_tests.py.

◆ errors

def run_tests.errors
Initial value:
1 = _build_and_run(check_cancelled=lambda: False,
2  newline_on_success=args.newline_on_success,
3  xml_report=args.xml_report,
4  build_only=args.build_only)

Definition at line 1687 of file run_tests.py.

◆ exit_code

int run_tests.exit_code = 0

Definition at line 1701 of file run_tests.py.

◆ flaky_tests

run_tests.flaky_tests = set()

Definition at line 1589 of file run_tests.py.

◆ gcp_utils_dir

run_tests.gcp_utils_dir
Initial value:
1 = os.path.abspath(
2  os.path.join(os.path.dirname(__file__), '../gcp/utils'))

Definition at line 54 of file run_tests.py.

◆ help

run_tests.help

Definition at line 1437 of file run_tests.py.

◆ languages

run_tests.languages = set(_LANGUAGES[l] for l in args.language)

Definition at line 1607 of file run_tests.py.

◆ measure_cpu_costs

run_tests.measure_cpu_costs

Definition at line 1597 of file run_tests.py.

◆ nargs

run_tests.nargs

Definition at line 1463 of file run_tests.py.

◆ post_tests_steps

run_tests.post_tests_steps
Initial value:
1 = list(
2  set(
3  jobset.JobSpec(cmdline,
4  environ=_build_step_environ(
5  build_config, extra_env=l.build_steps_environ()))
6  for l in languages
7  for cmdline in l.post_tests_steps()))

Definition at line 1678 of file run_tests.py.

◆ required

run_tests.required

Definition at line 1464 of file run_tests.py.

◆ retcode

run_tests.retcode
Initial value:
1 = subprocess.call(
2  'tools/run_tests/dockerize/build_and_run_docker.sh',
3  shell=True,
4  env=env)

Definition at line 1646 of file run_tests.py.

◆ run_config

run_tests.run_config = _CONFIGS[args.config]

Definition at line 1600 of file run_tests.py.

◆ run_tests_cmd

string run_tests.run_tests_cmd
Initial value:
1 = 'python3 tools/run_tests/run_tests.py %s' % ' '.join(
2  child_argv[1:])

Definition at line 1638 of file run_tests.py.

◆ runs_per_test

run_tests.runs_per_test = args.runs_per_test

Definition at line 1685 of file run_tests.py.

◆ shortname_to_cpu

dictionary run_tests.shortname_to_cpu = {}

Definition at line 1590 of file run_tests.py.

◆ type

run_tests.type

Definition at line 1436 of file run_tests.py.

run_tests._build_step_environ
def _build_step_environ(cfg, extra_env={})
Definition: run_tests.py:1160
cpp.gmock_class.set
set
Definition: bloaty/third_party/googletest/googlemock/scripts/generator/cpp/gmock_class.py:44
check_redundant_namespace_qualifiers.Config
Config
Definition: check_redundant_namespace_qualifiers.py:142
run_tests._build_and_run
def _build_and_run(check_cancelled, newline_on_success, xml_report=None, build_only=False)
Definition: run_tests.py:1298


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:43