def ReadProjectInfo(keys: List[str]) -> Dict[str, str]:
  """Read project information to run e2e test.

  Args:
    keys (List[str]): A list of mandatory dictionary keys that are expected
        to be present in the project_info file.

  Returns:
    dict: A dict with the project information.

  Raises:
    OSError: If the file cannot be found, opened or closed.
    RuntimeError: If the json file cannot be parsed.
    ValueError: If the json file does not have the required properties.
  """
  project_info_path = os.environ.get('PROJECT_INFO')
  if project_info_path is None:
    raise OSError(
        'Please make sure that you defined the '
        '"PROJECT_INFO" environment variable pointing '
        'to your project settings.')
  try:
    with open(project_info_path, encoding='utf-8') as json_file:
      try:
        project_info = json.load(json_file)  # type: Dict[str, str]
      except ValueError as exception:
        raise RuntimeError(
            'Cannot parse JSON file. {0:s}'.format(
                str(exception))) from exception
  except OSError as exception:
    raise OSError(
        'Could not open/close file {0:s}: {1:s}'.format(
            project_info_path, str(exception))) from exception

  if not all(key in project_info for key in keys):
    raise ValueError(
        'Please make sure that your JSON file '
        'has the required entries. The file should '
        'contain at least the following: {0:s}'.format(', '.join(keys)))
  return project_info
Read project information to run e2e test.

Args:
keys (List[str]): A list of mandatory dictionary keys that are expected
to be present in the project_info file.

Returns:
dict: A dict with the project information.

Raises:
OSError: If the file cannot be found, opened or closed.
RuntimeError: If the json file cannot be parsed.
ValueError: If the json file does not have the required properties.
tests/scripts/utils.py