Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add e2e test in build workflows #429

Merged
merged 10 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/build_canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,61 @@ jobs:
file: scaler/Dockerfile
context: .
push: true

smoke_tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3

- name: Helm install
uses: Azure/setup-helm@v1

- name: Create k8s v1.23 Kind Cluster
uses: JorTurFer/kind-action@main
with:
node_image: kindest/node:v1.23.0@sha256:49824ab1727c04e56a21a5d8372a402fcd32ea51ac96a2706a12af38934f81ac
cluster_name: http-add-on-smoke-tests-cluster

- name: Install KEDA
run: |
helm repo add kedacore https://kedacore.github.io/charts
helm repo update
helm install keda kedacore/keda --namespace keda --create-namespace --wait

- name: Show Kubernetes resources in keda namespace
run: kubectl get all --namespace keda

- name: Install Http-add-on
run: |
helm install http-add-on kedacore/keda-add-ons-http --set images.tag=canary --namespace http-add-on --create-namespace --wait

- name: Show Kubernetes resources in http-add-on namespace
run: kubectl get all --namespace http-add-on

- name: Create resources
run: |
kubectl create ns app
helm install xkcd ./examples/xkcd --set autoscaling.http.minReplicas=1 -n app --wait

- name: Show Kubernetes resources in app namespace
run: kubectl get all --namespace app

- name: Check http-add-on generated ScaledObject
run: |
n=0
max=5
until [ "$n" -ge "$max" ]
do
ready=$(kubectl get so xkcd-app -n app -o jsonpath="{.status.conditions[0].status}")
echo "ready: $ready"
if [ $ready == "True" ]; then
break
fi
n=$((n+1))
sleep 15
done

if [ $n -eq $max ]; then
echo "The HPA is not working correctly"
exit 1
fi
58 changes: 58 additions & 0 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,61 @@ jobs:
file: scaler/Dockerfile
context: .
push: true

smoke_tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3

- name: Helm install
uses: Azure/setup-helm@v1

- name: Create k8s v1.23 Kind Cluster
uses: JorTurFer/kind-action@main
with:
node_image: kindest/node:v1.23.0@sha256:49824ab1727c04e56a21a5d8372a402fcd32ea51ac96a2706a12af38934f81ac
cluster_name: http-add-on-smoke-tests-cluster

- name: Install KEDA
run: |
helm repo add kedacore https://kedacore.github.io/charts
helm repo update
helm install keda kedacore/keda --namespace keda --create-namespace --wait

- name: Show Kubernetes resources in keda namespace
run: kubectl get all --namespace keda

- name: Install Http-add-on
run: |
helm install http-add-on kedacore/keda-add-ons-http --set images.tag=${{ steps.get_version.outputs.VERSION }} --namespace http-add-on --create-namespace --wait

- name: Show Kubernetes resources in http-add-on namespace
run: kubectl get all --namespace http-add-on

- name: Create resources
run: |
kubectl create ns app
helm install xkcd ./examples/xkcd --set autoscaling.http.minReplicas=1 -n app --wait

- name: Show Kubernetes resources in app namespace
run: kubectl get all --namespace app

- name: Check http-add-on generated ScaledObject
run: |
n=0
max=5
until [ "$n" -ge "$max" ]
do
ready=$(kubectl get so xkcd-app -n app -o jsonpath="{.status.conditions[0].status}")
echo "ready: $ready"
if [ $ready == "True" ]; then
break
fi
n=$((n+1))
sleep 15
done

if [ $n -eq $max ]; then
echo "The HPA is not working correctly"
exit 1
fi