def RunPackageTesting()

in annotated_steps.py [0:0]


def RunPackageTesting(bot_info, package_path, folder='test'):
  package_name = os.path.basename(package_path)
  if package_name == '':
    # when package_path had a trailing slash
    package_name = os.path.basename(os.path.dirname(package_path))
  if folder == 'build/test':
    suffix = ' under build'
    package_root = os.path.join(package_path, folder, 'packages')
    package_arg = '--package-root=%s' % package_root
  else:
    suffix = ''
    package_spec_file = os.path.join(package_path, '.packages')
    package_arg = '--packages=%s' % package_spec_file


  # Note: we use package_name/package_name/folder and not package_name/folder on
  # purpose. The first package_name denotes the suite, the second is part of the
  # path we want to match. Without the second package_name, we may match tests
  # that contain "folder" further down. So if folder is "test",
  # "package_name/test" matches "package_name/build/test", but
  # "package_name/package_name/test" does not.
  standard_args = ['--arch=ia32',
                   '--suite-dir=%s' % package_path,
                   '--use-sdk', '--report', '--progress=buildbot',
                   '--reset-browser-configuration',
                   package_arg,
                   '--write-debug-log', '-v',
                   '--time',
                   '%s/%s/%s/' % (package_name, package_name, folder)]
  with BuildStep('Test vm release mode%s' % suffix, swallow_error=True):
    args = [sys.executable, 'tools/test.py',
            '-mrelease', '-rvm', '-cnone'] + standard_args
    args.extend(LogsArgument())
    # For easy integration testing we give access to the sdk bin directory.
    # This only makes sense on vm testing.
    extra_env = { 'DART_SDK_BIN' : GetSdkBin(bot_info) }
    RunProcess(args, extra_env=extra_env)
  with BuildStep('Test analyzer%s' % suffix, swallow_error=True):
    args = [sys.executable, 'tools/test.py',
            '-mrelease', '-rnone', '-cdart2analyzer'] + standard_args
    args.extend(LogsArgument())
    RunProcess(args)
  # TODO(27065): Restore Dartium testing once it works on test.py again.
  for runtime in JS_RUNTIMES[bot_info.system]:
    with BuildStep('dart2js-%s%s' % (runtime, suffix), swallow_error=True):
      test_args = [sys.executable, 'tools/test.py',
                   '-mrelease', '-r%s' % runtime, '-cdart2js', '-j4',
                   '--dart2js-batch']
      args = test_args + standard_args
      args.extend(LogsArgument())
      _RunWithXvfb(bot_info, args)