Skip to content

Commit

Permalink
Merge pull request #1 from controlplaneio-fluxcd/e2e-tests
Browse files Browse the repository at this point in the history
Add end-to-end test suite for Flux sources
  • Loading branch information
stefanprodan authored Feb 3, 2024
2 parents d620c2f + 9e72974 commit cb7cbbe
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/x-test.yaml → .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: x-test
name: e2e

on:
workflow_dispatch:
push:
branches:
- '*'
branches-ignore:
- main
tags-ignore:
- '*'

Expand All @@ -19,6 +17,7 @@ jobs:
fail-fast: false
matrix:
variant:
- alpine
- distroless
kubernetes:
- v1.29.0
Expand Down Expand Up @@ -66,7 +65,10 @@ jobs:
--path=./tests/${{ matrix.flux }}/clusters/kind
- name: Verify cluster reconciliation
run: |
kubectl -n flux-system wait kustomization/sources --for=condition=ready --timeout=5m
kubectl -n flux-system wait kustomization/sources --for=condition=ready --timeout=2m
- name: Verify managed resources
run: |
flux tree kustomization flux-system
- name: Debug failure
if: failure()
run: |
Expand Down
16 changes: 16 additions & 0 deletions tests/v2.2/clusters/kind/sources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: sources
namespace: flux-system
spec:
serviceAccountName: kustomize-controller
interval: 10m
sourceRef:
kind: GitRepository
name: flux-system
path: ./tests/v2.2/sources
prune: true
wait: true
timeout: 5m
69 changes: 69 additions & 0 deletions tests/v2.2/sources/helm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: podinfo-https
namespace: sources
spec:
interval: 10m
url: https://stefanprodan.github.io/podinfo
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmChart
metadata:
name: podinfo-https
namespace: sources
spec:
interval: 10m
chart: podinfo
reconcileStrategy: ChartVersion
sourceRef:
kind: HelmRepository
name: podinfo-https
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: podinfo-oci
namespace: sources
spec:
type: oci
interval: 10m
url: oci://ghcr.io/stefanprodan/charts
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmChart
metadata:
name: podinfo-oci
namespace: sources
spec:
interval: 10m
chart: podinfo
reconcileStrategy: ChartVersion
sourceRef:
kind: HelmRepository
name: podinfo-oci
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: podinfo-git
namespace: sources
spec:
interval: 10m
url: https://github.com/stefanprodan/podinfo
ref:
semver: ">1.0.0"
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmChart
metadata:
name: podinfo-git
namespace: sources
spec:
interval: 10m
chart: ./charts/podinfo
reconcileStrategy: Revision
sourceRef:
kind: GitRepository
name: podinfo-git
6 changes: 6 additions & 0 deletions tests/v2.2/sources/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: sources

16 changes: 16 additions & 0 deletions tests/v2.2/sources/oci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: OCIRepository
metadata:
name: podinfo-cosign
namespace: sources
spec:
interval: 10m
url: oci://ghcr.io/stefanprodan/manifests/podinfo
ref:
semver: ">1.0.0"
verify:
provider: cosign
matchOIDCIdentity:
- issuer: "^https://token.actions.githubusercontent.com$"
subject: "^https://github.com/stefanprodan/podinfo.*$"

0 comments on commit cb7cbbe

Please sign in to comment.