11cb0ef41Sopenharmony_ci# Src-side test specifications
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ciSrc-side test specifications enable developers to quickly add tests running on
41cb0ef41Sopenharmony_cispecific bots on V8's continuous infrastructure (CI) or tryserver. Features to
51cb0ef41Sopenharmony_cibe tested must live behind runtime flags, which are mapped to named testing
61cb0ef41Sopenharmony_civariants specified [here](https://chromium.googlesource.com/v8/v8/+/master/tools/testrunner/local/variants.py).
71cb0ef41Sopenharmony_ciChanges to src-side test specifications go through CQ like any other CL and
81cb0ef41Sopenharmony_cirequire tests added for specific trybots to pass.
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_ciThe test specifications are defined in a V8-side python-literal file
111cb0ef41Sopenharmony_ci`infra/testing/builders.pyl`.
121cb0ef41Sopenharmony_ci
131cb0ef41Sopenharmony_ciThe structure of the file is:
141cb0ef41Sopenharmony_ci```
151cb0ef41Sopenharmony_ci{
161cb0ef41Sopenharmony_ci  <buildername>: {
171cb0ef41Sopenharmony_ci    'tests': [
181cb0ef41Sopenharmony_ci      {
191cb0ef41Sopenharmony_ci        'name': <test-spec name>,
201cb0ef41Sopenharmony_ci        'suffix': <step suffix>,
211cb0ef41Sopenharmony_ci        'variant': <variant name>,
221cb0ef41Sopenharmony_ci        'shards': <number of shards>,
231cb0ef41Sopenharmony_ci        'test_args': <list of flags>,
241cb0ef41Sopenharmony_ci        'swarming_task_attrs': {...},
251cb0ef41Sopenharmony_ci        'swarming_dimensions': {...},
261cb0ef41Sopenharmony_ci      },
271cb0ef41Sopenharmony_ci      ...
281cb0ef41Sopenharmony_ci    ],
291cb0ef41Sopenharmony_ci    'swarming_task_attrs': {...},
301cb0ef41Sopenharmony_ci    'swarming_dimensions': {...},
311cb0ef41Sopenharmony_ci  },
321cb0ef41Sopenharmony_ci  ...
331cb0ef41Sopenharmony_ci}
341cb0ef41Sopenharmony_ci```
351cb0ef41Sopenharmony_ciThe `<buildername>` is a string name of the builder to execute the tests.
361cb0ef41Sopenharmony_ci`<test-spec name>` is a label defining a test specification matching the
371cb0ef41Sopenharmony_ci[infra-side](https://chromium.googlesource.com/chromium/tools/build/+/refs/heads/master/recipes/recipe_modules/v8/testing.py).
381cb0ef41Sopenharmony_ciThe optional `suffix` will be appended to test-step names for disambiguation.
391cb0ef41Sopenharmony_ciThe optional `variant` is a testing variant specified
401cb0ef41Sopenharmony_ci[here](https://chromium.googlesource.com/v8/v8/+/master/tools/testrunner/local/variants.py).
411cb0ef41Sopenharmony_ciThe optional `shards` (default 1) can be provided to increase the swarming
421cb0ef41Sopenharmony_cishards for long-running tests.
431cb0ef41Sopenharmony_ciThe optional `test_args` is a list of string flags that will be passed to the
441cb0ef41Sopenharmony_ciV8 test driver.
451cb0ef41Sopenharmony_ciThe optional `swarming_task_attrs` is a dict allowing to override the defaults
461cb0ef41Sopenharmony_cifor `priority`, `expiration` and `hard_timeout`.
471cb0ef41Sopenharmony_ciThe optional `swarming_dimensions` is a dict allowing to override the defaults
481cb0ef41Sopenharmony_cifor `cpu`, `cores` and `os`.
491cb0ef41Sopenharmony_ciBoth `swarming_task_attrs` and `swarming_dimensions` can be defined per builder
501cb0ef41Sopenharmony_ciand per test, whereas the latter takes precedence.
511cb0ef41Sopenharmony_ci
521cb0ef41Sopenharmony_ciExample:
531cb0ef41Sopenharmony_ci```
541cb0ef41Sopenharmony_ci{
551cb0ef41Sopenharmony_ci  'v8_linux64_rel_ng_triggered': {
561cb0ef41Sopenharmony_ci    'tests': [
571cb0ef41Sopenharmony_ci      {
581cb0ef41Sopenharmony_ci        'name': 'v8testing',
591cb0ef41Sopenharmony_ci        'suffix': 'stress',
601cb0ef41Sopenharmony_ci        'variant': 'nooptimization',
611cb0ef41Sopenharmony_ci        'shards': 2,
621cb0ef41Sopenharmony_ci        'test_args': ['--gc-stress'],
631cb0ef41Sopenharmony_ci        'swarming_dimensions': {'os': 'Ubuntu-14.4'},
641cb0ef41Sopenharmony_ci      },
651cb0ef41Sopenharmony_ci    ],
661cb0ef41Sopenharmony_ci    'swarming_properties': {'priority': 35},
671cb0ef41Sopenharmony_ci    'swarming_dimensions': {'os': 'Ubuntu'},
681cb0ef41Sopenharmony_ci  },
691cb0ef41Sopenharmony_ci}
701cb0ef41Sopenharmony_ci```
711cb0ef41Sopenharmony_ci
721cb0ef41Sopenharmony_ci## Guidelines
731cb0ef41Sopenharmony_ci
741cb0ef41Sopenharmony_ciPlease keep trybots and continuous bots in sync. E.g. add the same configuration
751cb0ef41Sopenharmony_cifor the release and debug CI bots and the corresponding trybot (where
761cb0ef41Sopenharmony_ciapplicable). E.g.
771cb0ef41Sopenharmony_ci
781cb0ef41Sopenharmony_ci```
791cb0ef41Sopenharmony_citryserver.v8:
801cb0ef41Sopenharmony_ci  v8_linux64_rel_ng_triggered
811cb0ef41Sopenharmony_ciclient.v8:
821cb0ef41Sopenharmony_ci  V8 Linux64
831cb0ef41Sopenharmony_ci  V8 Linux64 - debug
841cb0ef41Sopenharmony_ci```
851cb0ef41Sopenharmony_ci
861cb0ef41Sopenharmony_ciPlease only add tests that are expected to pass, or skip failing tests via
871cb0ef41Sopenharmony_cistatus file for the selected testing variants only. If you want to add FYI tests
881cb0ef41Sopenharmony_ci(i.e. not closing the tree and not blocking CQ) you can do so for the following
891cb0ef41Sopenharmony_ciset of bots:
901cb0ef41Sopenharmony_ci
911cb0ef41Sopenharmony_ci```
921cb0ef41Sopenharmony_citryserver.v8:
931cb0ef41Sopenharmony_ci  v8_linux64_fyi_rel_ng_triggered
941cb0ef41Sopenharmony_ciclient.v8:
951cb0ef41Sopenharmony_ci  V8 Linux64 - fyi
961cb0ef41Sopenharmony_ci  V8 Linux64 - debug - fyi
971cb0ef41Sopenharmony_ci```
98