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

Commit

Permalink
Update kfctl test to v0.7.1 -> v1.0.0 (#207)
Browse files Browse the repository at this point in the history
* Update kfctl test to v0.7.1 -> v1.0.0

* run upgrade test

* add random string to kfam profile

* fix test

* fix typo
  • Loading branch information
richardsliu authored Feb 3, 2020
1 parent c42f9f3 commit 521fcfe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions pkg/kfupgrade/kfupgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ func MergeKfCfg(oldKfCfg *kfconfig.KfConfig, newKfCfg *kfconfig.KfConfig) {
kfconfig.MINIKUBE_PLUGIN_KIND,
kfconfig.EXISTING_ARRIKTO_PLUGIN_KIND,
}

for _, kind := range pluginKinds {
oldPlugin := kfdefgcpplugin.GcpPluginSpec{}
err := oldKfCfg.GetPluginSpec(kind, &oldPlugin)
Expand Down
4 changes: 2 additions & 2 deletions prow_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ workflows:
# test_endpoint flag is actually deprecated; we use pytest annotations to skip on
# presubmit.
test_endpoint: true
config_path: https://raw.githubusercontent.com/kubeflow/manifests/v0.7-branch/kfdef/kfctl_gcp_iap.0.7.0.yaml
upgrade_spec_path: https://raw.githubusercontent.com/kubeflow/manifests/v0.7-branch/kfdef/kfctl_upgrade_gcp_iap_0.7.1.yaml
config_path: https://raw.githubusercontent.com/kubeflow/manifests/v0.7-branch/kfdef/kfctl_gcp_iap.0.7.1.yaml
upgrade_spec_path: https://raw.githubusercontent.com/kubeflow/manifests/master/kfdef/kfctl_upgrade_gcp_iap_1.0.0.yaml
# E2E tests for kfctl_istio_dex
# - app_dir: kubeflow/kubeflow/testing/workflows
# component: kfctl_go_test
Expand Down
10 changes: 6 additions & 4 deletions py/kubeflow/kfctl/testing/pytests/kfam_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import json
from retrying import retry
from time import sleep
import uuid


logging.basicConfig(level=logging.INFO,
Expand All @@ -27,21 +28,22 @@ def test_kfam(record_xml_attribute):

sleep(10)
# Profile Creation
profile_name = "testprofile-%s" % uuid.uuid4().hex[0:7]
util.run(['kubectl', 'exec', jupyterpod, '-n', 'kubeflow', '--', 'curl',
'--silent', '-X', 'POST', '-d',
'{"metadata":{"name":"testprofile"},"spec":{"owner":{"kind":"User","name":"[email protected]"}}}',
'{"metadata":{"name":"%s"},"spec":{"owner":{"kind":"User","name":"[email protected]"}}}' % profile_name,
'profiles-kfam.kubeflow:8081/kfam/v1/profiles'])

assert verify_profile_creation(jupyterpod)
assert verify_profile_creation(jupyterpod, profile_name)

@retry(wait_fixed=2000, stop_max_delay=20 * 1000)
def verify_profile_creation(jupyterpod):
def verify_profile_creation(jupyterpod, profile_name):
# Verify Profile Creation
bindingsstr = util.run(['kubectl', 'exec', jupyterpod, '-n', 'kubeflow', '--', 'curl', '--silent',
'profiles-kfam.kubeflow:8081/kfam/v1/bindings'])
bindings = json.loads(bindingsstr)

if "testprofile" not in [binding['referredNamespace'] for binding in bindings['bindings']]:
if profile_name not in [binding['referredNamespace'] for binding in bindings['bindings']]:
raise Exception("testprofile not created yet!")
return True

Expand Down

0 comments on commit 521fcfe

Please sign in to comment.