From ccd6942c063eabab6ccd5c94383e6880c2277822 Mon Sep 17 00:00:00 2001 From: Jeremy Lewi Date: Wed, 17 Jun 2020 11:42:05 -0700 Subject: [PATCH] Update kf_is_ready_test.py to work with GCP blueprints (#355) * kf_is_ready_test.py currently assumes we have access to the KFDef and can use that to determine the platform and trigger platform specific tests. * With blueprints and when running against auto deployed clusters we won't have the KFDef; so in this case just set platform = "" and don't trigger platform specific logic. * Related to kubeflow/gcp-blueprints#52 --- py/kubeflow/kfctl/testing/pytests/kf_is_ready_test.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/py/kubeflow/kfctl/testing/pytests/kf_is_ready_test.py b/py/kubeflow/kfctl/testing/pytests/kf_is_ready_test.py index bc754145..89839b0c 100644 --- a/py/kubeflow/kfctl/testing/pytests/kf_is_ready_test.py +++ b/py/kubeflow/kfctl/testing/pytests/kf_is_ready_test.py @@ -23,7 +23,15 @@ def set_logging(): ) logging.getLogger().setLevel(logging.INFO) +# TODO(jlewi): We should probably deprecate this and find a better way +# to separate platform specific logic. With GCP and blueprints we won't +# have a KFDef. And when running periodically against auto-deployments +# we also won't have access to the kfapp. def get_platform_app_name(app_path): + if not app_path: + logging.info("--app_path not set; won't use KFDef to set platform") + return "", "" + with open(os.path.join(app_path, "tmp.yaml")) as f: kfdef = yaml.safe_load(f) app_name = kfdef["metadata"]["name"] @@ -270,4 +278,6 @@ def test_gcp_access(record_xml_attribute, namespace, app_path, project): datefmt='%Y-%m-%dT%H:%M:%S', ) logging.getLogger().setLevel(logging.INFO) + # DO NOT SUBMIT + #test_notebook_is_ready("jupyter", "kubeflow") pytest.main()