def validate_testapps(apis, api_configs):
  """Ensures the chosen apis are valid, based on the config."""
  if "all" in apis:
    return [key for key in api_configs]

  for api in apis:
    if api not in api_configs:
      raise RuntimeError("Testapp given as flag not found in config: %s" % api)
  return apis