Skip to content

fix(testing): Add Variable expansion testing #1123

fix(testing): Add Variable expansion testing

fix(testing): Add Variable expansion testing #1123

name: Test operator-wandb Chart
on:
pull_request:
paths:
- charts/operator-wandb/**
- test-configs/operator-wandb/**
jobs:
snapshots:
name: Snapshot testing
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.17.0
- name: Helm snapshot build and test
run: |
pushd ./charts/operator-wandb/
helm repo add stakater https://stakater.github.io/stakater-charts
helm repo add prometheus https://prometheus-community.github.io/helm-charts
popd
helm plugin install https://github.com/origranot/helm-cascade
helm cascade build ./charts/operator-wandb/
helm plugin install https://github.com/jlandowner/helm-chartsnap
./snapshots.sh run
# currently this action always tries to install helm, so dont use it for now
- name: Chart Snapshots
if: ${{ !always() }}
uses: jlandowner/helm-chartsnap-action@v1
id: chartsnap
with:
chart: charts/operator-wandb/
values: test-configs/operator-wandb/
test:
name: Test Chart
strategy:
fail-fast: false
max-parallel: 20
matrix:
k8s-version: ["v1.32.2", "v1.31.6", "v1.30.10"]
configuration:
[
"default",
"fmb",
"oidc-secret-from-k8s",
"runs-v2-bufstream",
"separate-pods",
"url-encoded-password",
"user-defined-secrets",
"weave-trace",
"weave-trace-with-worker",
"historystore-parquet-only",
]
runs-on: ubuntu-latest-8-cores
concurrency:
group: ${{ github.workflow }}-${{ matrix.k8s-version }}-${{ matrix.configuration }}-${{ github.ref }}
cancel-in-progress: true
environment: Helm Charts
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.17.0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Set up chart-testing
uses: helm/[email protected]
with:
version: v3.12.0
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config ct.yaml)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Create kind cluster
uses: helm/[email protected]
with:
version: v0.27.0
cluster_name: chart-testing-${{ matrix.k8s-version }}-${{ matrix.configuration }}
node_image: kindest/node:${{ matrix.k8s-version }}
if: env.ACT || steps.list-changed.outputs.changed == 'true'
- name: Install Minio
run: kubectl --context kind-chart-testing-${{ matrix.k8s-version }}-${{ matrix.configuration }} apply -f test-configs/minio/default.yaml
if: env.ACT || steps.list-changed.outputs.changed == 'true'
- name: Wait for Minio to be Ready
run: kubectl --context kind-chart-testing-${{ matrix.k8s-version }}-${{ matrix.configuration }} wait --for=condition=Ready pod/minio --timeout=300s
if: env.ACT || steps.list-changed.outputs.changed == 'true'
- name: Install Keycloak
run: kubectl --context kind-chart-testing-${{ matrix.k8s-version }}-${{ matrix.configuration }} apply -f test-configs/keycloak/default.yaml
if: env.ACT || steps.list-changed.outputs.changed == 'true'
- name: Wait for Keycloak to be Ready
run: kubectl --context kind-chart-testing-${{ matrix.k8s-version }}-${{ matrix.configuration }} wait --for=condition=Ready pod/keycloak-0 --timeout=300s
if: env.ACT || steps.list-changed.outputs.changed == 'true'
- name: Install pubsub and bigtable emulators
run: |
helm --kube-context kind-chart-testing-${{ matrix.k8s-version }}-${{ matrix.configuration }} install pubsub-wandb-base ./charts/wandb-base --values test-configs/pubsub/values.yaml
helm --kube-context kind-chart-testing-${{ matrix.k8s-version }}-${{ matrix.configuration }} install bigtable-wandb-base ./charts/wandb-base --values test-configs/bigtable/values.yaml
if: (env.ACT || steps.list-changed.outputs.changed == 'true') && matrix.configuration == 'fmb'
- name: Apply user defined secrets
run: |
if [[ -d test-configs/additional-resources/${{matrix.configuration}} ]]; then
kubectl --context kind-chart-testing-${{ matrix.k8s-version }}-${{ matrix.configuration }} apply -f test-configs/additional-resources/${{matrix.configuration}}
else
echo "No additional resources to be applied for ${{matrix.configuration}}"
fi
if: env.ACT || steps.list-changed.outputs.changed == 'true'
- name: Run chart-testing (install)
env:
LICENSE: ${{ secrets.LICENSE }}
if: env.ACT || steps.list-changed.outputs.changed == 'true'
run: |
ct install --namespace default \
--charts ./charts/operator-wandb \
--config ct.yaml \
--helm-extra-args '--kube-context kind-chart-testing-${{ matrix.k8s-version }}-${{ matrix.configuration }} --timeout 600s' \
--helm-extra-set-args '--values test-configs/operator-wandb/${{ matrix.configuration }}.yaml --set=license=$LICENSE'