def METHOD_NAME(test_root, tests):
  buildbot = False
  if "BUILD_NUMBER" in os.environ:
    buildbot = {
      'build_id': os.environ['JOB_NAME'] + ' ' + os.environ["BUILD_NUMBER"],
      'build_link': os.environ['BUILD_URL']
    }
  git_info = {
    'branch': check_output(['git symbolic-ref HEAD 2>/dev/null || echo "HEAD"'], shell=True),
    'commit': check_output(['git', 'rev-parse', 'HEAD']),
    'message': check_output(['git', 'show', '-s', '--format=%B'])
  }
  tests_param = format_tests(test_root, tests)
  passed = sum(1 for test in tests_param if test['status'] == 'pass')
  total = len(tests_param)
  # TODO: use `rethinkdb --version' instead
  rethinkdb_version = check_output([os.path.dirname(__file__) + "/../../scripts/gen-version.sh"])
  reportData = {
    "buildbot": buildbot,
    "tests": tests_param,
    "rethinkdb_version": rethinkdb_version,
    "git_info": git_info,
    "passed_test_count": passed,
    "total_test_count": total
  }
  generate_html(test_root + "/test_results.html", reportData)
  print('Wrote test report to "%s/test_results.html"' % os.path.realpath(test_root))