# Copyright 2018 The V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Please keep builder names, builder configs and test definitions sorted.
# Builder names should be sorted alphabetically. Builder configs should have
# keys sorted in the alphabetical order except 'tests' key, which should always
# come last. Test definitions must have keys in the following order, but omit
# optional fields:
#  * name (required)
#  * variant
#  * test_args
#  * shards
#  * suffix
#  * swarming_dimensions
#  * swarming_task_attrs
#
# Please also format test definitions as a single line with ', ' separating
# fields, e.g.
#
#   {'name': 'v8testing', 'variant': 'extra', 'shards': 2}
#
# After formatting test definitions this way, please sort them alphabetically by
# test name. For all variants of the test with the same name, the
# least-qualified test (no variant, no test args) should come first. You may
# also deviate from the alphabetical order if necessary and group tests
# differently, but in this case please add a comment before each group and
# continue to sort tests using the rules above within each group.

{
  ##############################################################################
  ### luci.v8.try
  ##############################################################################
  # Android
  'v8_android_arm64_n5x_rel_ng_triggered': {
    'swarming_dimensions' : {
      'device_os': 'MMB29Q',
      'device_type': 'bullhead',
      'os': 'Android',
    },
    'tests': [
      {'name': 'benchmarks', 'variant': 'default'},
      {'name': 'v8testing', 'variant': 'default', 'shards': 4},
      {'name': 'mozilla', 'variant': 'default'},
      {'name': 'test262_variants', 'variant': 'default', 'shards': 6},
    ],
  },
  ##############################################################################
  # Linux32
  'v8_linux_dbg_ng_triggered': {
    'swarming_dimensions' : {
      'cpu': 'x86-64-avx2',
    },
    'tests': [
      {'name': 'benchmarks'},
      {'name': 'benchmarks', 'variant': 'extra'},
      {'name': 'mjsunit_sp_frame_access'},
      {'name': 'mozilla'},
      {'name': 'mozilla', 'variant': 'extra'},
      {'name': 'test262'},
      {'name': 'test262_variants', 'variant': 'extra', 'shards': 3},
      {'name': 'v8testing', 'shards': 3},
      {'name': 'v8testing', 'variant': 'extra', 'shards': 2},
    ],
  },
  'v8_linux_gc_stress_dbg': {
    'tests': [
      {'name': 'mjsunit', 'variant': 'slow_path', 'test_args': ['--gc-stress'], 'shards': 2},
      {'name': 'd8testing', 'test_args': ['--gc-stress'], 'shards': 5},
    ],
  },
  'v8_linux_gcc_rel': {
    'tests': [
      {'name': 'v8testing'},
    ],
  },
  'v8_linux_nodcheck_rel_ng_triggered': {
    'swarming_dimensions' : {
      'cpu': 'x86-64-avx2',
    },
    'tests': [
      {'name': 'benchmarks'},
      {'name': 'benchmarks', 'variant': 'extra'},
      {'name': 'mozilla'},
      {'name': 'mozilla', 'variant': 'extra'},
      {'name': 'test262_variants', 'shards': 2},
      {'name': 'test262_variants', 'variant': 'extra', 'shards': 2},
      {'name': 'v8testing', 'shards': 2},
      {'name': 'v8testing', 'variant': 'extra'},
    ],
  },
  'v8_linux_noi18n_rel_ng_triggered': {
    'tests': [
      {'name': 'mozilla', 'variant': 'default'},
      {'name': 'test262', 'variant': 'default'},
      {'name': 'v8testing', 'variant': 'default', 'shards': 2},
    ],
  },
  'v8_linux_nosnap_rel': {
    'tests': [
      {'name': 'v8testing', 'variant': 'default', 'shards': 4},
    ],
  },
  'v8_linux_nosnap_dbg': {
    'swarming_task_attrs': {
      'hard_timeout': 3600,
    },
    'tests': [
      {'name': 'v8testing', 'variant': 'default', 'shards': 9},
    ],
  },
  'v8_linux_rel_ng_triggered': {
    'swarming_dimensions' : {
      'cpu': 'x86-64-avx2',
    },
    'tests': [
      {'name': 'benchmarks'},
      {'name': 'benchmarks', 'variant': 'extra'},
      {'name': 'gcmole'},
      {'name': 'mjsunit_sp_frame_access'},
      {'name': 'mozilla'},
      {'name': 'mozilla', 'variant': 'extra'},
      {'name': 'optimize_for_size'},
      {'name': 'test262_variants', 'shards': 4},
      {'name': 'test262_variants', 'variant': 'extra', 'shards': 2},
      {'name': 'v8testing', 'shards': 2},
      {'name': 'v8testing', 'suffix': 'isolates', 'test_args': ['--isolates'], 'shards': 2},
      {'name': 'v8testing', 'variant': 'extra'},
    ],
  },
  'v8_linux_optional_rel_ng_triggered': {
    'swarming_dimensions' : {
      'cpu': 'x86-64-avx2',
    },
    'tests': [
      # Code serializer.
      {'name': 'benchmarks', 'variant': 'code_serializer', 'shards': 1},
      {'name': 'd8testing', 'variant': 'code_serializer', 'shards': 1},
      {'name': 'mozilla', 'variant': 'code_serializer', 'shards': 1},
      {'name': 'test262_variants', 'variant': 'code_serializer', 'shards': 1},
      # No SSE3.
      {
        'name': 'mozilla',
        'suffix': 'nosse3',
        'test_args': [
          '--extra-flags',
          '--noenable-sse3 --noenable-ssse3 --noenable-sse4-1 --noenable-avx',
        ],
      },
      {
        'name': 'test262',
        'suffix': 'nosse3',
        'test_args': [
          '--extra-flags',
          '--noenable-sse3 --noenable-ssse3 --noenable-sse4-1 --noenable-avx',
        ],
      },
      {
        'name': 'v8testing',
        'suffix': 'nosse3',
        'test_args': [
          '--extra-flags',
          '--noenable-sse3 --noenable-ssse3 --noenable-sse4-1 --noenable-avx',
        ],
        'shards': 3,
      },
      # No SSE4.
      {
        'name': 'mozilla',
        'suffix': 'nosse4',
        'test_args': ['--extra-flags', '--noenable-sse4-1 --noenable-avx'],
      },
      {
        'name': 'test262',
        'suffix': 'nosse4',
        'test_args': ['--extra-flags', '--noenable-sse4-1 --noenable-avx'],
      },
      {
        'name': 'v8testing',
        'suffix': 'nosse4',
        'test_args': ['--extra-flags', '--noenable-sse4-1 --noenable-avx'],
        'shards': 3,
      },
    ],
  },
  'v8_linux_verify_csa_rel_ng_triggered': {
    'tests': [
      {'name': 'v8testing', 'shards': 2},
    ],
  },
  ##############################################################################
  # Linux32 with arm simulators
  'v8_linux_arm_dbg': {
    'tests': [
      {'name': 'mjsunit_sp_frame_access'},
      {'name': 'mozilla'},
      {'name': 'test262'},
      {'name': 'v8testing', 'shards': 7},
      {'name': 'v8testing', 'variant': 'extra', 'shards': 3},
    ],
  },
  'v8_linux_arm_rel_ng_triggered': {
    'tests': [
      {'name': 'mjsunit_sp_frame_access'},
      {'name': 'mozilla', 'shards': 2},
      {'name': 'test262', 'shards': 2},
      {'name': 'v8testing', 'shards': 8},
      {'name': 'v8testing', 'variant': 'extra', 'shards': 3},
    ],
  },
  ##############################################################################
  # Linux64
  'v8_linux64_asan_rel_ng_triggered': {
    'tests': [
      {'name': 'test262_variants', 'shards': 7},
      {'name': 'v8testing', 'shards': 3},
      {'name': 'v8testing', 'variant': 'extra', 'shards': 2},
      {'name': 'v8testing', 'variant': 'slow_path'},
    ],
  },
  'v8_linux64_cfi_rel_ng_triggered': {
    'tests': [
      {'name': 'benchmarks'},
      {'name': 'mozilla'},
      {'name': 'optimize_for_size'},
      {'name': 'test262'},
      {'name': 'v8testing', 'shards': 2},
    ],
  },
  'v8_linux64_dbg_ng_triggered': {
    'swarming_dimensions' : {
      'cpu': 'x86-64-avx2',
    },
    'tests': [
      {'name': 'benchmarks'},
      {'name': 'benchmarks', 'variant': 'extra'},
      {'name': 'mjsunit_sp_frame_access'},
      {'name': 'mozilla'},
      {'name': 'mozilla', 'variant': 'extra'},
      {'name': 'test262'},
      {'name': 'test262_variants', 'variant': 'extra', 'shards': 3},
      {'name': 'v8testing', 'shards': 3},
      {'name': 'v8testing', 'variant': 'extra', 'shards': 2},
      {'name': 'v8testing', 'variant': 'minor_mc', 'shards': 1},
    ],
  },
  'v8_linux64_fyi_rel_ng_triggered': {
    'tests': [
      # Stress sampling.
      {'name': 'mjsunit', 'variant': 'stress_sampling'},
      {'name': 'webkit', 'variant': 'stress_sampling'},
      # Infra staging.
      {'name': 'test262_variants', 'variant': 'infra_staging', 'shards': 2},
      {'name': 'v8testing', 'variant': 'infra_staging', 'shards': 2},
    ],
  },
  'v8_linux64_msan_rel': {
    'tests': [
      {'name': 'test262', 'shards': 2},
      {'name': 'v8testing', 'shards': 5},
    ],
  },
  'v8_linux64_rel_ng_triggered': {
    'swarming_dimensions' : {
      'cpu': 'x86-64-avx2',
    },
    'tests': [
      # TODO(machenbach): Add benchmarks.
      # TODO(machenbach): Add mozilla tests.
      {'name': 'mjsunit_sp_frame_access'},
      {'name': 'optimize_for_size'},
      {'name': 'test262_variants', 'shards': 4},
      {'name': 'test262_variants', 'variant': 'extra', 'shards': 2},
      {'name': 'v8initializers'},
      {'name': 'v8testing', 'shards': 2},
      {'name': 'v8testing', 'variant': 'extra'},
      {'name': 'v8testing', 'variant': 'minor_mc'},
      {'name': 'v8testing', 'variant': 'slow_path'},
    ],
  },
  'v8_linux64_tsan_rel': {
    'tests': [
      {'name': 'benchmarks'},
      {'name': 'mozilla'},
      {'name': 'test262', 'shards': 3},
      {'name': 'v8testing', 'shards': 5},
      {'name': 'v8testing', 'variant': 'extra', 'shards': 3},
      {'name': 'v8testing', 'variant': 'slow_path'},
    ],
  },
  'v8_linux64_tsan_isolates_rel_ng_triggered': {
    'tests': [
      {'name': 'v8testing', 'test_args': ['--isolates'], 'shards': 7},
    ],
  },
  'v8_linux64_ubsan_rel_ng_triggered': {
    'tests': [
      {'name': 'v8testing', 'shards': 2},
    ],
  },
  'v8_linux64_verify_csa_rel_ng_triggered': {
    'tests': [
      {'name': 'v8testing', 'shards': 2},
    ],
  },
  ##############################################################################
  # Linux64 with arm64 simulators
  'v8_linux_arm64_dbg': {
    'tests': [
      {'name': 'mjsunit_sp_frame_access'},
      {'name': 'mozilla'},
      {'name': 'test262'},
      {'name': 'v8testing', 'shards': 7},
      {'name': 'v8testing', 'variant': 'extra', 'shards': 3},
    ],
  },
  'v8_linux_arm64_gc_stress_dbg': {
    'tests': [
      {'name': 'd8testing', 'test_args': ['--gc-stress'], 'shards': 8},
    ],
  },
  'v8_linux_arm64_rel_ng_triggered': {
    'tests': [
      {'name': 'mjsunit_sp_frame_access'},
      {'name': 'mozilla', 'shards': 2},
      {'name': 'test262', 'shards': 2},
      {'name': 'v8testing', 'shards': 9},
      {'name': 'v8testing', 'variant': 'extra', 'shards': 4},
    ],
  },
  ##############################################################################
  # Odroids with native arm
  'v8_odroid_arm_rel_ng_triggered': {
    'swarming_dimensions' : {
      'cores': '8',
      'cpu': 'armv7l-32-ODROID-XU4',
      'os': 'Ubuntu-16.04',
    },
    'swarming_task_attrs': {
      # Use same prio as CI due to limited resources.
      'priority': 25,
    },
    'tests': [
      {'name': 'benchmarks'},
      {'name': 'optimize_for_size'},
      {'name': 'v8testing', 'shards': 2},
    ],
  },
  ##############################################################################
  # Win32
  'v8_win_dbg': {
    'swarming_dimensions' : {
      'cpu': 'x86-64',
      'os': 'Windows-7-SP1',
    },
    'tests': [
      {'name': 'mozilla'},
      {'name': 'v8testing', 'shards': 3},
    ],
  },
  'v8_win_nosnap_shared_rel_ng_triggered': {
    'swarming_dimensions' : {
      'cpu': 'x86-64',
      'os': 'Windows-7-SP1',
    },
    'tests': [
      {'name': 'v8testing', 'variant': 'default', 'shards': 3},
    ],
  },
  'v8_win_rel_ng_triggered': {
    'swarming_dimensions' : {
      'cpu': 'x86-64',
      'os': 'Windows-7-SP1',
    },
    'tests': [
      {'name': 'test262'},
      {'name': 'v8testing', 'shards': 2},
    ],
  },
  ##############################################################################
  # Win64
  'v8_win64_asan_rel_ng_triggered': {
    'swarming_dimensions' : {
      'os': 'Windows-10',
    },
    'tests': [
      {'name': 'v8testing', 'shards': 5},
    ],
  },
  'v8_win64_dbg': {
    'swarming_dimensions' : {
      'cpu': 'x86-64',
      'os': 'Windows-7-SP1',
    },
    'tests': [
      {'name': 'mozilla'},
      {'name': 'test262', 'shards': 2},
      {'name': 'v8testing', 'shards': 3},
      {'name': 'v8testing', 'variant': 'extra', 'shards': 2},
    ],
  },
  'v8_win64_msvc_rel_ng_triggered': {
    'swarming_dimensions' : {
      'cpu': 'x86-64',
      'os': 'Windows-7-SP1',
    },
    'tests': [
      {'name': 'mozilla'},
      {'name': 'test262'},
      {'name': 'v8testing', 'shards': 2},
    ],
  },
  'v8_win64_rel_ng_triggered': {
    'swarming_dimensions' : {
      'cpu': 'x86-64',
      'os': 'Windows-7-SP1',
    },
    'tests': [
      {'name': 'test262'},
      {'name': 'v8testing', 'shards': 2},
      {'name': 'v8testing', 'variant': 'extra'},
    ],
  },
  ##############################################################################
  # Mac64
  'v8_mac64_asan_rel': {
    'swarming_dimensions' : {
      'cpu': 'x86-64',
      'os': 'Mac-10.13',
    },
    'tests': [
      {'name': 'v8testing', 'shards': 4},
    ],
  },
  'v8_mac64_dbg_ng_triggered': {
    'swarming_dimensions' : {
      'cpu': 'x86-64',
      'os': 'Mac-10.13',
    },
    'tests': [
      {'name': 'mozilla'},
      {'name': 'test262'},
      {'name': 'v8testing', 'shards': 3},
      {'name': 'v8testing', 'variant': 'extra', 'shards': 2},
    ],
  },
  'v8_mac64_gc_stress_dbg': {
    'swarming_dimensions' : {
      'cpu': 'x86-64',
      'os': 'Mac-10.13',
    },
    'tests': [
      {'name': 'd8testing', 'test_args': ['--gc-stress'], 'shards': 4},
    ],
  },
  'v8_mac64_rel_ng_triggered': {
    'swarming_dimensions' : {
      'cpu': 'x86-64',
      'os': 'Mac-10.13',
    },
    'tests': [
      {'name': 'mozilla'},
      {'name': 'test262'},
      {'name': 'v8testing', 'shards': 2},
      {'name': 'v8testing', 'variant': 'extra'},
    ],
  },
  ##############################################################################
  ### luci.v8.ci
  ##############################################################################
  # Linux32
  'V8 Linux - debug': {
    'tests': [
      {'name': 'benchmarks', 'variant': 'code_serializer', 'shards': 1},
      {'name': 'd8testing', 'variant': 'code_serializer', 'shards': 1},
      {'name': 'mozilla', 'variant': 'code_serializer', 'shards': 1},
      {'name': 'test262_variants', 'variant': 'code_serializer', 'shards': 1},
    ],
  },
  'V8 Linux - gc stress': {
    'tests': [
      {'name': 'mjsunit', 'variant': 'slow_path', 'shards': 2},
    ],
  },
  ##############################################################################
  # Linux64
  'V8 Linux64': {
    'tests': [
      {'name': 'v8testing', 'variant': 'minor_mc', 'shards': 1},
    ],
  },
  'V8 Linux64 - debug': {
    'tests': [
      {'name': 'v8testing', 'variant': 'minor_mc', 'shards': 1},
      {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1},
    ],
  },
  'V8 Linux64 - debug - fyi': {
    'tests': [
      # Infra staging.
      {'name': 'test262_variants', 'variant': 'infra_staging', 'shards': 3},
      {'name': 'v8testing', 'variant': 'infra_staging', 'shards': 2},
      # Stress sampling.
      {'name': 'mjsunit', 'variant': 'stress_sampling', 'shards': 1},
      {'name': 'webkit', 'variant': 'stress_sampling', 'shards': 1},
    ],
  },
  'V8 Linux64 - fyi': {
    'tests': [
      {'name': 'mjsunit', 'variant': 'stress_sampling', 'shards': 1},
      {'name': 'test262_variants', 'variant': 'infra_staging', 'shards': 2},
      {'name': 'v8testing', 'variant': 'infra_staging', 'shards': 1},
      {'name': 'webkit', 'variant': 'stress_sampling', 'shards': 1},
    ],
  },
  'V8 Linux64 ASAN': {
    'tests': [
      {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1},
    ],
  },
  'V8 Linux64 TSAN': {
    'tests': [
      {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1},
    ],
  },
}