Skip to content

Commit

Permalink
re-enable more parts of the dex test (#2854)
Browse files Browse the repository at this point in the history
* renable more parts of the dex test

Signed-off-by: juliusvonkohout <45896133+juliusvonkohout@users.noreply.github.com>

* fix dex-login-test (#2830)

* fix dex-login-test:
- set executable permission for python script
- set shebang line in python script

Signed-off-by: Tom Zaspel <40226087+tzabbi@users.noreply.github.com>

* Add all required componentes which have to be installed to test dex login

Signed-off-by: Tom Zaspel <tom@zaspel.it>

* Add kustomizeation file to deploy all required stuff to test dex login

Signed-off-by: Tom Zaspel <tom@zaspel.it>

* Add statuscode response in dex login

Signed-off-by: Tom Zaspel <40226087+tzabbi@users.noreply.github.com>

---------

Signed-off-by: Tom Zaspel <40226087+tzabbi@users.noreply.github.com>
Signed-off-by: Tom Zaspel <tom@zaspel.it>

---------

Signed-off-by: juliusvonkohout <45896133+juliusvonkohout@users.noreply.github.com>
Signed-off-by: Tom Zaspel <40226087+tzabbi@users.noreply.github.com>
Signed-off-by: Tom Zaspel <tom@zaspel.it>
Co-authored-by: Tom Zaspel <40226087+tzabbi@users.noreply.github.com>
  • Loading branch information
juliusvonkohout and tzabbi committed Aug 25, 2024
1 parent e04bd39 commit d7834bc
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 8 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/dex_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@ jobs:
- name: Install KinD, Create KinD cluster and Install kustomize
run: ./tests/gh-actions/install_KinD_create_KinD_cluster_install_kustomize.sh

- name: Install Istio
run: ./tests/gh-actions/install_istio.sh

- name: Build & Apply manifests
run: |
cd common/dex
kustomize build overlays/istio | kubectl apply -f -
while ! kustomize build ./tests/gh-actions/deploy-dex-login-environment | kubectl apply -f -; do echo "Retrying to apply resources"; sleep 20; done
kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout 180s
- name: port forward
Expand All @@ -35,5 +31,4 @@ jobs:
- name: test dex login
run: |
pip3 install requests
# currently broken
# ./tests/gh-actions/test_dex_login.py
./tests/gh-actions/test_dex_login.py
58 changes: 58 additions & 0 deletions tests/gh-actions/deploy-dex-login-environment/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

sortOptions:
order: legacy
legacySortOptions:
orderFirst:
- Namespace
- ResourceQuota
- StorageClass
- CustomResourceDefinition
- MutatingWebhookConfiguration
- ServiceAccount
- PodSecurityPolicy
- NetworkPolicy
- Role
- ClusterRole
- RoleBinding
- ClusterRoleBinding
- ConfigMap
- Secret
- Endpoints
- Service
- LimitRange
- PriorityClass
- PersistentVolume
- PersistentVolumeClaim
- Deployment
- StatefulSet
- CronJob
- PodDisruptionBudget
orderLast:
- ValidatingWebhookConfiguration

resources:
# Istio
- ../../../common/istio-1-22/istio-crds/base
- ../../../common/istio-1-22/istio-namespace/base
- ../../../common/istio-1-22/istio-install/overlays/oauth2-proxy
# oauth2-proxy
- ../../../common/oauth2-proxy/overlays/m2m-self-signed
# Dex
- ../../../common/dex/overlays/oauth2-proxy
- ../../../common/istio-1-22/cluster-local-gateway/base
# Kubeflow namespace
- ../../../common/kubeflow-namespace/base
# NetworkPolicies
- ../../../common/networkpolicies/base
# Kubeflow Roles
- ../../../common/kubeflow-roles/base
# Kubeflow Istio Resources
- ../../../common/istio-1-22/kubeflow-istio-resources/base
# Central Dashboard
- ../../../apps/centraldashboard/overlays/oauth2-proxy
# Profiles + KFAM
- ../../../apps/profiles/upstream/overlays/kubeflow
# User namespace
- ../../../common/user-namespace/base
4 changes: 3 additions & 1 deletion tests/gh-actions/test_dex_login.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import re
import requests
import sys
Expand Down Expand Up @@ -101,7 +103,7 @@ def get_istio_auth_session(url: str, username: str, password: str) -> dict:
username=KUBEFLOW_USERNAME,
password=KUBEFLOW_PASSWORD
)

print(f"{resp}")
if resp == 200:
sys.exit(0)
else:
Expand Down

0 comments on commit d7834bc

Please sign in to comment.