Skip to content

Commit

Permalink
[Test] : e2e Github Action Workflow (OT-CONTAINER-KIT#661)
Browse files Browse the repository at this point in the history
* github action

Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>

* fix naming

Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>

* install kubectl

Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>

* install kind utility

Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>

* name kind

Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>

* deploy operator

* fix test dir

Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>

* fix current dir

Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>

* run without deploye

Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>

* make deploye

Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>

* make  with version

Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>

* upgrade kustomize

Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>

* fix image

Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>

* update pull policy

Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>

* disable webhook for deployment

* disable webhook

Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>

* print logs

Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>

* logs

Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>

* check kind images

Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>

* wait

Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>

* log 2

Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>

* remove

Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>

---------

Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>
Co-authored-by: drivebyer <wuyangmuc@gmail.com>
Signed-off-by: Matt Robinson <mattrobinsonsre@gmail.com>
  • Loading branch information
2 people authored and mattrobinsonsre committed Jul 11, 2024
1 parent ac161b6 commit 88209c5
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 5 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: E2E tests

on:
pull_request:
branches:
- master
push:
branches:
- master

jobs:
test:
name: ${{ matrix.testpath }}
runs-on: ubuntu-latest
strategy:
matrix:
testpath:
- ./tests/e2e/v1beta2/setup

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Build Dockerfile
run: docker build . --file Dockerfile --tag redis-operator:e2e

- name: Install kuttl
run: |
curl -L https://github.com/kudobuilder/kuttl/releases/download/v0.15.0/kubectl-kuttl_0.15.0_linux_x86_64 -o /usr/local/bin/kuttl
chmod +x /usr/local/bin/kuttl
- name: Install kubectl
run: |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1.5.0
with:
config: tests/_config/kind-config.yaml
cluster_name: kind

- name: Load Docker image into Kind
run: |
kubectl cluster-info --context kind-kind
kind load docker-image redis-operator:e2e --name kind
- name: Install Redis Operator
run: |
make deploy
- name: Wait for Redis Operator to be ready
run: |
kubectl wait --for=condition=available --timeout=300s deployment/redis-operator-redis-operator -n redis-operator-system
- name: Run kuttl test
run: kuttl test ${{ matrix.testpath }} --config tests/_config/kuttl-test.yaml
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ controller-gen:
# Download kustomize locally if necessary
KUSTOMIZE = $(shell pwd)/bin/kustomize
kustomize:
$(call go-install-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v3@v3.8.7)
$(call go-install-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v4@v4.5.4)

# go-install-tool will 'go install' any package $2 and install it to $1.
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
Expand Down
4 changes: 2 additions & 2 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: quay.io/opstree/redis-operator
newTag: v0.15.0
newName: redis-operator
newTag: e2e
8 changes: 6 additions & 2 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ spec:
containers:
- command:
- /manager
env:
- name: ENABLE_WEBHOOKS
value: "false"
args:
- --leader-elect
- -zap-log-level=info
image: quay.io/opstree/redis-operator:v0.12.0
imagePullPolicy: Always
- -enable-webhooks=false
image: redis-operator:e2e
imagePullPolicy: IfNotPresent
name: manager
securityContext:
allowPrivilegeEscalation: false
Expand Down

0 comments on commit 88209c5

Please sign in to comment.