Skip to content

Commit

Permalink
add e2e tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sanskar Jaiswal <[email protected]>
  • Loading branch information
aryan9600 committed Feb 15, 2022
1 parent badabfe commit e116b38
Show file tree
Hide file tree
Showing 6 changed files with 394 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
- gloo
- skipper
- kubernetes
- gatewayapi
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
30 changes: 30 additions & 0 deletions test/gatewayapi/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

set -o errexit

CONTOUR_VER="release-1.20"
GATEWAY_API_VER="v1alpha2"
REPO_ROOT=$(git rev-parse --show-toplevel)
KUSTOMIZE_VERSION=4.5.2
OS=$(uname -s)
ARCH=$(arch)

mkdir -p ${REPO_ROOT}/bin

echo ">>> Installing Contour ${CONTOUR_VER}, Gateway API components ${GATEWAY_API_VER}"
cd ${REPO_ROOT}/bin && \
kubectl apply -f https://raw.githubusercontent.com/projectcontour/contour/${CONTOUR_VER}/examples/render/contour-gateway.yaml

kubectl -n projectcontour rollout status deployment/contour
kubectl -n projectcontour get all

echo '>>> Installing Kustomize'
cd ${REPO_ROOT}/bin && kustomize_url=https:/kubernetes-sigs/kustomize/releases/download && \
curl -sL ${kustomize_url}/kustomize%2Fv${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_${OS}_${ARCH}.tar.gz | \
tar xz

echo '>>> Installing Flagger'
${REPO_ROOT}/bin/kustomize build ${REPO_ROOT}/test/gatewayapi | kubectl apply -f -

kubectl -n projectcontour set image deployment/flagger flagger=test/flagger:latest
kubectl -n projectcontour rollout status deployment/flagger
6 changes: 6 additions & 0 deletions test/gatewayapi/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace: projectcontour
bases:
- ../../kustomize/base/flagger/
- ../../kustomize/base/prometheus/
patchesStrategicMerge:
- patch.yaml
15 changes: 15 additions & 0 deletions test/gatewayapi/patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: flagger
spec:
template:
spec:
containers:
- name: flagger
image: aryan9600/flagger
args:
- -log-level=debug
- -include-label-prefix=app.kubernetes.io
- -mesh-provider=gatewayapi
- -metrics-server=http://flagger-prometheus:9090
11 changes: 11 additions & 0 deletions test/gatewayapi/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -o errexit

REPO_ROOT=$(git rev-parse --show-toplevel)
DIR="$(cd "$(dirname "$0")" && pwd)"

"$DIR"/install.sh

"$REPO_ROOT"/test/workloads/init.sh
"$DIR"/run-canary.sh
Loading

0 comments on commit e116b38

Please sign in to comment.