-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add e2e tests for simple gerrit deployment (#68)
* Update GH Actions and add e2e tests * Do simple deployment, which guaranies no issue with deployment and Tekton Tasks/Piplines references Signed-off-by: Sergiy Kulanov <[email protected]> Change-Id: I34ef2d3c8090245bb7d91afe8699893b048c02f5
- Loading branch information
Showing
15 changed files
with
238 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: "Run End-to-end tests" | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
e2e-tests: | ||
name: End-to-end tests | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# The e2e tests are run on the lowest and highest supported k8s version. | ||
# All Kubernetes version in between expose the same APIs, hence the operator | ||
# should be compatible with them. | ||
kube-version: | ||
- "1.27" | ||
|
||
steps: | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.20" | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v4 | ||
|
||
- name: "install kuttl" | ||
run: ./hack/install-kuttl.sh | ||
|
||
- name: "run tests" | ||
env: | ||
KUBE_VERSION: ${{ matrix.kube-version }} | ||
run: make start-kind KUBE_VERSION=$KUBE_VERSION && make e2e | ||
|
||
e2e-tests-check: | ||
runs-on: ubuntu-20.04 | ||
if: always() | ||
needs: [e2e-tests] | ||
steps: | ||
- name: Print result | ||
run: echo ${{ needs.e2e-tests.result }} | ||
- name: Interpret result | ||
run: | | ||
if [[ success == ${{ needs.e2e-tests.result }} ]] | ||
then | ||
echo "All matrix jobs passed!" | ||
else | ||
echo "One or more matrix jobs failed." | ||
false | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,5 @@ coverage.out | |
### Python test | ||
.venv | ||
__pycache__/ | ||
|
||
kubeconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
# patch the generated kubeadm config with some extra settings | ||
kubeadmConfigPatches: | ||
- | | ||
apiVersion: kubelet.config.k8s.io/v1beta1 | ||
kind: KubeletConfiguration | ||
evictionHard: | ||
nodefs.available: "0%" | ||
# patch it further using a JSON 6902 patch | ||
kubeadmConfigPatchesJSON6902: | ||
- group: kubeadm.k8s.io | ||
version: v1beta3 | ||
kind: ClusterConfiguration | ||
patch: | | ||
- op: add | ||
path: /apiServer/certSANs/- | ||
value: my-hostname | ||
# 1 control plane node and 3 workers | ||
nodes: | ||
# the control plane node config | ||
- role: control-plane | ||
image: kindest/node:v1.26.3@sha256:61b92f38dff6ccc29969e7aa154d34e38b89443af1a2c14e6cfbd2df6419c66f | ||
# the three workers | ||
- role: worker | ||
image: kindest/node:v1.26.3@sha256:61b92f38dff6ccc29969e7aa154d34e38b89443af1a2c14e6cfbd2df6419c66f | ||
# - role: worker | ||
# image: kindest/node:v1.26.3@sha256:61b92f38dff6ccc29969e7aa154d34e38b89443af1a2c14e6cfbd2df6419c66f | ||
# - role: worker | ||
# image: kindest/node:v1.26.3@sha256:61b92f38dff6ccc29969e7aa154d34e38b89443af1a2c14e6cfbd2df6419c66f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
sudo curl -Lo /usr/local/bin/kubectl-kuttl https://github.com/kudobuilder/kuttl/releases/download/v0.15.0/kubectl-kuttl_0.15.0_linux_x86_64 | ||
sudo chmod +x /usr/local/bin/kubectl-kuttl | ||
export PATH=$PATH:/usr/local/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
nodes: | ||
- role: control-plane | ||
image: kindest/node:v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestSuite | ||
testDirs: | ||
- ./tests/e2e/ | ||
skipClusterDelete: false | ||
timeout: 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: cert-manager | ||
namespace: cert-manager | ||
status: | ||
readyReplicas: 1 | ||
|
||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: tekton-pipelines-controller | ||
namespace: tekton-pipelines | ||
status: | ||
readyReplicas: 1 | ||
|
||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: tekton-pipelines-webhook | ||
namespace: tekton-pipelines | ||
status: | ||
readyReplicas: 1 | ||
|
||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: tekton-triggers-controller | ||
namespace: tekton-pipelines | ||
status: | ||
readyReplicas: 1 | ||
|
||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: tekton-triggers-webhook | ||
namespace: tekton-pipelines | ||
status: | ||
readyReplicas: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
# install EDPComponent CRD first | ||
- command: kubectl apply -f https://raw.githubusercontent.com/epam/edp-component-operator/master/deploy-templates/crds/v1.edp.epam.com_edpcomponents.yaml | ||
namespaced: false | ||
# install GitServer CRD | ||
- command: kubectl apply -f https://raw.githubusercontent.com/epam/edp-codebase-operator/master/deploy-templates/crds/v2.edp.epam.com_gitservers.yaml | ||
namespaced: false | ||
# Install Cert manager which is used by Interceptor | ||
- command: kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.13.2/cert-manager.yaml | ||
namespaced: false | ||
# install Tekton | ||
- command: kubectl create ns tekton-pipelines | ||
namespaced: false | ||
- command: kubectl create ns tekton-pipelines-resolvers | ||
namespaced: false | ||
- command: kubectl apply -f https://storage.googleapis.com/tekton-releases/triggers/latest/release.yaml | ||
namespaced: false | ||
- command: kubectl apply -f https://storage.googleapis.com/tekton-releases/triggers/latest/interceptors.yaml | ||
namespaced: false | ||
- command: kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml | ||
namespaced: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: edp-tekton-dashboard | ||
status: | ||
readyReplicas: 1 | ||
|
||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: edp-tekton-interceptor | ||
status: | ||
readyReplicas: 1 | ||
|
||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: el-gerrit-listener | ||
status: | ||
readyReplicas: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- command: | | ||
helm install tekton-e2e ../../../charts/pipelines-library --set interceptor.image.repository=${E2E_IMAGE_REPOSITORY} --set interceptor.image.tag=${E2E_IMAGE_TAG} | ||
--set global.dnsWildCard=example.com | ||
--set global.gitProvider=gerrit | ||
--set global.dockerRegistry.type=harbor | ||
--set global.dockerRegistry.url=harbor.example.com | ||
--replace --wait | ||
namespaced: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- command: helm uninstall tekton-e2e | ||
namespaced: true |