f13ab967ea8c284a67fa2d5c8a3f0e585910c258,testing/kfctl/kfctl_go_test.py,,test_build_kfctl_go,#Any#Any#Any#Any#Any#,164

Before Change



  // We need to use retries because if we don"t we see random failures
  // where kfctl just appears to die.
  run_with_retries([
      kfctl_path, "generate", "-V", "all", "--email=" + email, "--zone=" + zone
  ],
                   cwd=app_path)

  // Do not run with retries since it masks errors

After Change



  logging.info("Using app path %s", app_path)
  zone = "us-central1-a"
  os.environ["ZONE"] = zone
  if not zone:
    raise ValueError("Could not get zone being used")
  // We need to specify a valid email because
  //  1. We need to create appropriate RBAC rules to allow the current user
  //     to create the required K8s resources.
  //  2. Setting the IAM policy will fail if the email is invalid.
  email = util.run(["gcloud", "config", "get-value", "account"])
  os.environ["EMAIL"] = email
  if not email:
    raise ValueError("Could not determine GCP account being used.")
  os.environ["PROJECT"] = project
  if not project:
    raise ValueError("Could not get project being used")
  // username and password are passed as env vars and won"t appear in the logs
  //
  config_spec = get_config_spec(config_path, project, email)

  // Set KfDef name to be unique
  regex = re.compile("[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?")
  kfdef_name = regex.findall(app_path)[-1]
  config_spec["metadata"]["name"] = kfdef_name

  if not os.path.exists(parent_dir):
    os.makedirs(parent_dir)
  if not os.path.exists(app_path):
    os.makedirs(app_path)

  with open(os.path.join(parent_dir, "tmp.yaml"), "w") as f:
    yaml.dump(config_spec, f)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: kubeflow/kubeflow
Commit Name: f13ab967ea8c284a67fa2d5c8a3f0e585910c258
Time: 2019-10-03
Author: adhita94@gmail.com
File Name: testing/kfctl/kfctl_go_test.py
Class Name:
Method Name: test_build_kfctl_go


Project Name: kubeflow/kubeflow
Commit Name: f13ab967ea8c284a67fa2d5c8a3f0e585910c258
Time: 2019-10-03
Author: adhita94@gmail.com
File Name: testing/kfctl/kfctl_go_test.py
Class Name:
Method Name: test_build_kfctl_go


Project Name: aliyun/aliyun-odps-python-sdk
Commit Name: 736acd98bf679ffa816a36a149b497aff32ba931
Time: 2017-11-16
Author: wenjun.swj@alibaba-inc.com
File Name: odps/lib/tests/test_importer.py
Class Name: Test
Method Name: testBinaryImport


Project Name: philipperemy/deep-speaker
Commit Name: 20c399028672a7beb92cabcd580265fbe057c5eb
Time: 2018-09-15
Author: premy@cogent.co.jp
File Name: v2/audio/generate_all_cache.py
Class Name:
Method Name: main