From 7abb7ccf60b8e328a34621444f50de56913fec2e Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Fri, 18 Sep 2020 15:10:25 +0300 Subject: [PATCH] Add Bucket e2e tests --- .github/workflows/e2e.yaml | 24 +++++++++++++++++++ .../minio/manifests/namespace/role.yaml | 2 +- config/testdata/minio/source.yaml | 2 -- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 70be4e51..4aab0cde 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -29,6 +29,8 @@ jobs: uses: fluxcd/pkg/actions/kustomize@master - name: Setup Kubebuilder uses: fluxcd/pkg/actions/kubebuilder@master + - name: Setup Helm + uses: fluxcd/pkg/actions/helm@master - name: Run tests run: make test env: @@ -64,6 +66,27 @@ jobs: kubectl -n source-system wait helmchart/mariadb --for=condition=ready --timeout=5m kubectl -n source-system wait helmchart/mariadb-git --for=condition=ready --timeout=5m kubectl -n source-system delete -f ./config/testdata/helmchart-valuesfile + - name: Setup Minio + run: | + kubectl create ns minio + helm repo add minio https://helm.min.io/ + helm upgrade --wait -i minio minio/minio \ + --namespace minio \ + --set accessKey=myaccesskey \ + --set secretKey=mysecretkey \ + --set resources.requests.memory=128Mi \ + --set persistence.enable=false + kubectl -n minio port-forward svc/minio 9000:9000 &>/dev/null & + sleep 2 + wget -q https://dl.min.io/client/mc/release/linux-amd64/mc + chmod +x mc + ./mc alias set minio http://localhost:9000 myaccesskey mysecretkey --api S3v4 + ./mc mb minio/podinfo + ./mc cp --recursive ./config/testdata/minio/manifests minio/podinfo + - name: Run S3 tests + run: | + kubectl -n source-system apply -f ./config/testdata/minio/source.yaml + kubectl -n source-system wait bucket/podinfo --for=condition=ready --timeout=1m - name: Debug failure if: failure() run: | @@ -72,3 +95,4 @@ jobs: kubectl -n source-system get helmcharts -oyaml kubectl -n source-system get all kubectl -n source-system logs deploy/source-controller + kubectl -n minio get all diff --git a/config/testdata/minio/manifests/namespace/role.yaml b/config/testdata/minio/manifests/namespace/role.yaml index 60ac2efa..9c46c023 100644 --- a/config/testdata/minio/manifests/namespace/role.yaml +++ b/config/testdata/minio/manifests/namespace/role.yaml @@ -10,4 +10,4 @@ roleRef: subjects: - apiGroup: rbac.authorization.k8s.io kind: User - name: gotk:web-team:reconciler + name: gotk:minio-test:reconciler diff --git a/config/testdata/minio/source.yaml b/config/testdata/minio/source.yaml index 94d7c2c8..ccd1ed8b 100644 --- a/config/testdata/minio/source.yaml +++ b/config/testdata/minio/source.yaml @@ -2,7 +2,6 @@ apiVersion: source.toolkit.fluxcd.io/v1alpha1 kind: Bucket metadata: name: podinfo - namespace: gitops-system spec: interval: 1m provider: generic @@ -17,7 +16,6 @@ apiVersion: v1 kind: Secret metadata: name: minio-credentials - namespace: gitops-system data: accesskey: bXlhY2Nlc3NrZXk= secretkey: bXlzZWNyZXRrZXk=