Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.

Commit

Permalink
Automated cherry pick of #218: test Cherry pick of #218 on v1.0-branch.
Browse files Browse the repository at this point in the history
#218: test (#219)

* test

* activate account

* skip

* remove skip
  • Loading branch information
richardsliu authored Feb 4, 2020
1 parent 521fcfe commit 24b60e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/kfapp/gcp/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,7 @@ func (gcp *Gcp) updateDM(resources kftypesv3.ResourceEnum) error {
"--zone="+gcp.kfDef.Spec.Zone,
"--project="+gcp.kfDef.Spec.Project)
credCmd.Stdout = os.Stdout
credCmd.Stderr = os.Stderr
log.Infof("Running get-credentials %v --zone=%v --project=%v ...", gcp.kfDef.Name,
gcp.kfDef.Spec.Zone, gcp.kfDef.Spec.Project)
if err := credCmd.Run(); err != nil {
Expand Down
8 changes: 6 additions & 2 deletions py/kubeflow/kfctl/testing/pytests/kfctl_second_apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
from kubeflow.testing import util


@pytest.mark.skipif(os.getenv("JOB_TYPE") == "presubmit",
reason="test second apply doesn't run in presubmits")
def test_second_apply(record_xml_attribute, app_path, kfctl_path):
"""Test that we can run kfctl apply again with error.
Expand All @@ -20,4 +18,10 @@ def test_second_apply(record_xml_attribute, app_path, kfctl_path):
msg = "kfctl Go binary not found: {path}".format(path=kfctl_path)
logging.error(msg)
raise RuntimeError(msg)

# Need to activate account for scopes.
if os.getenv("GOOGLE_APPLICATION_CREDENTIALS"):
util.run(["gcloud", "auth", "activate-service-account",
"--key-file=" + os.environ["GOOGLE_APPLICATION_CREDENTIALS"]])

util.run([kfctl_path, "apply", "-V", "-f=" + os.path.join(app_path, "tmp.yaml")], cwd=app_path)

0 comments on commit 24b60e8

Please sign in to comment.