-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Nicolas Bigler <nicolas.bigler@vshn.ch>
- Loading branch information
Showing
5 changed files
with
115 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: E2E | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test-e2e: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Run tests | ||
run: make test-e2e | ||
env: | ||
KUBECONFIG: ${{ secrets.LAB_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestSuite | ||
testDirs: | ||
- ./test/e2e/ | ||
namespace: default | ||
timeout: 60 |
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,41 @@ | ||
### | ||
### E2E Tests | ||
### with KUTTL (https://kuttl.dev) | ||
### | ||
|
||
kuttl_bin = $(go_bin)/kubectl-kuttl | ||
$(kuttl_bin): export GOBIN = $(go_bin) | ||
$(kuttl_bin): | $(go_bin) | ||
go install github.com/kudobuilder/kuttl/cmd/kubectl-kuttl@latest | ||
|
||
mc_bin = $(go_bin)/mc | ||
$(mc_bin): export GOBIN = $(go_bin) | ||
$(mc_bin): | $(go_bin) | ||
go install github.com/minio/mc@latest | ||
|
||
test-e2e: export KUBECONFIG = $(KIND_KUBECONFIG) | ||
test-e2e: $(kuttl_bin) $(mc_bin) local-install provider-config ## E2E tests | ||
GOBIN=$(go_bin) $(kuttl_bin) test ./test/e2e --config ./test/e2e/kuttl-test.yaml --suppress-log=Events | ||
@rm -f kubeconfig | ||
# kuttl leaves kubeconfig garbage: https://github.com/kudobuilder/kuttl/issues/297 | ||
|
||
run-single-e2e: export KUBECONFIG = $(KIND_KUBECONFIG) | ||
run-single-e2e: $(kuttl_bin) $(mc_bin) local-install provider-config ## Run specific e2e test with `run-single-e2e test=$name` | ||
GOBIN=$(go_bin) $(kuttl_bin) test ./test/e2e --config ./test/e2e/kuttl-test.yaml --suppress-log=Events --test $(test) | ||
@rm -f kubeconfig | ||
|
||
.PHONY: .e2e-test-clean | ||
.e2e-test-clean: export KUBECONFIG = $(KIND_KUBECONFIG) | ||
.e2e-test-clean: | ||
@if [ -f $(KIND_KUBECONFIG) ]; then \ | ||
kubectl delete buckets --all; \ | ||
kubectl delete iamkeys --all; \ | ||
kubectl delete postgresql --all; \ | ||
kubectl delete mysql --all; \ | ||
kubectl delete redis --all; \ | ||
kubectl delete kafka --all; \ | ||
kubectl delete opensearch --all; \ | ||
else \ | ||
echo "no kubeconfig found"; \ | ||
fi | ||
rm -f $(kuttl_bin) $(mc_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,13 @@ | ||
apiVersion: vshn.appcat.vshn.io/v1 | ||
kind: VSHNMariaDB | ||
metadata: | ||
name: mariadb-e2e-test | ||
namespace: appcat-e2e | ||
spec: | ||
parameters: | ||
service: | ||
version: "11.2" | ||
size: | ||
plan: standard-2 | ||
writeConnectionSecretToRef: | ||
name: mariadb-creds |
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,38 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: connect-mariadb | ||
namespace: appcat-e2e | ||
spec: | ||
backoffLimit: 5 | ||
template: | ||
metadata: | ||
labels: | ||
e2e-test: mariadb | ||
spec: | ||
restartPolicy: Never | ||
containers: | ||
- name: connect | ||
image: dockerhub.vshn.net/bitnami/mariadb:latest | ||
imagePullPolicy: IfNotPresent | ||
command: | ||
- bash | ||
args: | ||
- -c | ||
- echo "Testing Select...\n" && mysql -h $MYSQL_HOST -u $MYSQL_USER --password="$MYSQL_PASSWORD" -P $MYSQL_PORT $MYSQL_DB -c -e "select 1;" | ||
env: | ||
- name: SSL_MODE | ||
value: VERIFY_CA | ||
envFrom: | ||
- secretRef: | ||
name: e2e-test-mysql-details | ||
volumeMounts: | ||
- name: ca | ||
mountPath: /.mysql | ||
volumes: | ||
- name: ca | ||
secret: | ||
secretName: e2e-test-mysql-details | ||
items: | ||
- key: ca.crt | ||
path: root.crt |