Skip to content

Commit 85bf785

Browse files
authored
Merge pull request #523 from pjbgf/dec-patches
2 parents 05b980c + ec9e0f6 commit 85bf785

File tree

9 files changed

+1549
-108
lines changed

9 files changed

+1549
-108
lines changed

.github/actions/run-tests/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ARG GO_VERSION=1.17.5
33
ARG XX_VERSION=1.1.0
44

55
ARG LIBGIT2_IMG=ghcr.io/fluxcd/golang-with-libgit2
6-
ARG LIBGIT2_TAG=libgit2-1.1.1-1
6+
ARG LIBGIT2_TAG=libgit2-1.1.1-3
77

88
FROM tonistiigi/xx:${XX_VERSION} AS xx
99
FROM ${LIBGIT2_IMG}:${LIBGIT2_TAG} as libgit2

.github/workflows/e2e.yaml

Lines changed: 41 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ on:
77
- main
88

99
jobs:
10-
kind:
10+
11+
kind-linux-amd64:
1112
runs-on: ubuntu-latest
1213
steps:
1314
- name: Checkout
1415
uses: actions/checkout@v2
16+
- name: Setup Go
17+
uses: actions/setup-go@v2
18+
with:
19+
go-version: 1.17.x
1520
- name: Restore Go cache
1621
uses: actions/cache@v1
1722
with:
@@ -35,84 +40,44 @@ jobs:
3540
- name: Run tests
3641
uses: ./.github/actions/run-tests
3742
env:
43+
GOROOT:
3844
GOPATH: /github/home/go
39-
- name: Check if working tree is dirty
40-
run: |
41-
if [[ $(git diff --stat) != '' ]]; then
42-
git --no-pager diff
43-
echo 'run make test and commit changes'
44-
exit 1
45-
fi
46-
- name: Build container image
47-
run: make docker-build IMG=test/source-controller TAG=latest BUILD_PLATFORMS=linux/amd64 BUILD_ARGS=--load
48-
- name: Load test image
49-
run: kind load docker-image test/source-controller:latest
50-
- name: Deploy controller
51-
run: make dev-deploy IMG=test/source-controller TAG=latest
52-
- name: Run smoke tests
53-
run: |
54-
kubectl -n source-system apply -f ./config/samples
55-
kubectl -n source-system rollout status deploy/source-controller --timeout=1m
56-
kubectl -n source-system wait gitrepository/gitrepository-sample --for=condition=ready --timeout=1m
57-
kubectl -n source-system wait helmrepository/helmrepository-sample --for=condition=ready --timeout=1m
58-
kubectl -n source-system wait helmchart/helmchart-sample --for=condition=ready --timeout=1m
59-
kubectl -n source-system delete -f ./config/samples
60-
- name: Run HelmChart values file tests
61-
run: |
62-
kubectl -n source-system apply -f ./config/testdata/helmchart-valuesfile
63-
kubectl -n source-system wait helmchart/podinfo --for=condition=ready --timeout=5m
64-
kubectl -n source-system wait helmchart/podinfo-git --for=condition=ready --timeout=5m
65-
kubectl -n source-system delete -f ./config/testdata/helmchart-valuesfile
66-
- name: Setup Minio
45+
- name: Verify
46+
run: make verify
47+
- name: Run E2E tests
6748
env:
68-
MINIO_VER: ${{ 'v6.3.1' }}
69-
run: |
70-
kubectl create ns minio
71-
helm repo add minio https://helm.min.io/
72-
helm upgrade --wait -i minio minio/minio \
73-
--version $MINIO_VER \
74-
--namespace minio \
75-
--set accessKey=myaccesskey \
76-
--set secretKey=mysecretkey \
77-
--set resources.requests.memory=128Mi \
78-
--set persistence.enable=false
79-
kubectl -n minio port-forward svc/minio 9000:9000 &>/dev/null &
80-
sleep 2
81-
wget -q https://dl.min.io/client/mc/release/linux-amd64/mc
82-
chmod +x mc
83-
./mc alias set minio http://localhost:9000 myaccesskey mysecretkey --api S3v4
84-
kubectl -n source-system apply -f ./config/testdata/minio/secret.yaml
85-
- name: Run Bucket tests
86-
run: |
87-
./mc mb minio/podinfo
88-
./mc mirror ./config/testdata/minio/manifests/ minio/podinfo
49+
CREATE_CLUSTER: false
50+
run: make e2e
8951

90-
kubectl -n source-system apply -f ./config/testdata/bucket/source.yaml
91-
kubectl -n source-system wait bucket/podinfo --for=condition=ready --timeout=1m
92-
- name: Run HelmChart from Bucket tests
93-
run: |
94-
./mc mb minio/charts
95-
./mc mirror ./controllers/testdata/charts/helmchart/ minio/charts/helmchart
96-
97-
kubectl -n source-system apply -f ./config/testdata/helmchart-from-bucket/source.yaml
98-
kubectl -n source-system wait bucket/charts --for=condition=ready --timeout=1m
99-
kubectl -n source-system wait helmchart/helmchart-bucket --for=condition=ready --timeout=1m
100-
- name: Run large Git repo tests
52+
kind-linux-arm64:
53+
# Hosted on Equinix
54+
# Docs: https://github.com/fluxcd/flux2/tree/main/.github/runners
55+
runs-on: [self-hosted, Linux, ARM64, equinix]
56+
steps:
57+
- name: Checkout
58+
uses: actions/checkout@v2
59+
- name: Setup Go
60+
uses: actions/setup-go@v2
61+
with:
62+
go-version: 1.17.x
63+
- name: Prepare
64+
id: prep
10165
run: |
102-
kubectl -n source-system apply -f ./config/testdata/git/large-repo.yaml
103-
kubectl -n source-system wait gitrepository/large-repo-go-git --for=condition=ready --timeout=2m
104-
kubectl -n source-system wait gitrepository/large-repo-libgit2 --for=condition=ready --timeout=2m
105-
- name: Logs
66+
echo ::set-output name=CLUSTER::arm64-${GITHUB_SHA:0:7}-$(date +%s)
67+
echo ::set-output name=CONTEXT::kind-arm64-${GITHUB_SHA:0:7}-$(date +%s)
68+
- name: Setup Kubernetes Kind
10669
run: |
107-
kubectl -n source-system logs deploy/source-controller
108-
- name: Debug failure
109-
if: failure()
70+
kind create cluster --name ${{ steps.prep.outputs.CLUSTER }} --kubeconfig=/tmp/${{ steps.prep.outputs.CLUSTER }}
71+
- name: Run e2e tests
72+
env:
73+
KIND_CLUSTER_NAME: ${{ steps.prep.outputs.CLUSTER }}
74+
KUBECONFIG: /tmp/${{ steps.prep.outputs.CLUSTER }}
75+
CREATE_CLUSTER: false
76+
BUILD_PLATFORM: linux/arm64
77+
MINIO_TAG: RELEASE.2020-09-17T04-49-20Z-arm64
78+
run: make e2e
79+
- name: Cleanup
80+
if: always()
11081
run: |
111-
kubectl -n kube-system describe pods
112-
kubectl -n source-system describe pods
113-
kubectl -n source-system get gitrepositories -oyaml
114-
kubectl -n source-system get helmrepositories -oyaml
115-
kubectl -n source-system get helmcharts -oyaml
116-
kubectl -n source-system get all
117-
kubectl -n source-system logs deploy/source-controller
118-
kubectl -n minio get all
82+
kind delete cluster --name ${{ steps.prep.outputs.CLUSTER }}
83+
rm /tmp/${{ steps.prep.outputs.CLUSTER }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ config/release/
1818

1919
# Exclude all libgit2 related files
2020
hack/libgit2/
21+
22+
# Exclude temporary build files
23+
build/

0 commit comments

Comments
 (0)