Bundle E2E Tests #532
Workflow file for this run
This file contains hidden or 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
| name: Bundle E2E Tests | |
| on: | |
| push: | |
| branches: | |
| - 'release-*' # for main branch we have the merge queue | |
| pull_request: | |
| merge_group: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test-bundle-e2e: | |
| name: Bundle E2E Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Free up disk space | |
| run: | | |
| # Remove large pre-installed toolchains not needed for K8s operator testing | |
| sudo rm -rf \ | |
| /usr/share/dotnet \ | |
| /usr/local/lib/android \ | |
| /opt/ghc \ | |
| /opt/hostedtoolcache \ | |
| /usr/local/share/powershell \ | |
| /usr/share/swift \ | |
| /usr/local/.ghcup \ | |
| /usr/local/share/chromium \ | |
| /usr/local/lib/heroku | |
| # Clean up Docker to start fresh | |
| docker system prune -af --volumes | |
| df -h | |
| - name: Clone the code | |
| uses: actions/checkout@v6 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Install the latest version of kind | |
| run: | | |
| curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64 | |
| chmod +x ./kind | |
| sudo mv ./kind /usr/local/bin/kind | |
| - name: Verify kind installation | |
| run: kind version | |
| - name: Install helm | |
| uses: azure/setup-helm@v5.0.0 | |
| # func CLI is needed in some e2e tests ATM | |
| - name: Install func cli | |
| uses: functions-dev/action@main | |
| with: | |
| version: nightly # use nightly as long as we use the latest in the operator too | |
| - name: Setup KinD cluster | |
| run: make create-kind-cluster | |
| - name: Running Bundle e2e Tests | |
| env: | |
| REGISTRY_INSECURE: true | |
| REGISTRY: kind-registry:5000 | |
| run: make test-e2e-bundle | |
| - name: Collect Kubernetes artifacts | |
| if: failure() | |
| run: | | |
| mkdir -p /tmp/k8s-artifacts | |
| kubectl logs -n func-operator-system -l control-plane=controller-manager --tail=-1 --all-containers --prefix --timestamps > /tmp/k8s-artifacts/func-operator.log || true | |
| for resource in functions deployments configmaps pipelineruns roles rolebindings; do | |
| kubectl get ${resource} -A -o yaml > /tmp/k8s-artifacts/${resource}.yaml || true | |
| done | |
| # Install Tekton CLI for better PipelineRun log collection | |
| curl -LO https://github.com/tektoncd/cli/releases/download/v0.44.1/tkn_0.44.1_Linux_x86_64.tar.gz | |
| tar xvzf tkn_0.44.1_Linux_x86_64.tar.gz -C /tmp | |
| chmod +x /tmp/tkn | |
| # Collect logs from all pipelineruns using Tekton CLI | |
| /tmp/tkn pipelinerun list -A > /tmp/k8s-artifacts/pipelinerun-list.txt 2>&1 || true | |
| kubectl get pipelineruns -A -o json | jq -r '.items[] | "\(.metadata.namespace) \(.metadata.name)"' | while read ns name; do | |
| /tmp/tkn pipelinerun logs $name -n $ns > /tmp/k8s-artifacts/pipelinerun-logs-${ns}-${name}.log 2>&1 || true | |
| done | |
| # Collect operator logs from all test namespaces (bundle tests install into dynamic namespaces) | |
| for ns in $(kubectl get namespaces -o jsonpath='{.items[*].metadata.name}' | tr ' ' '\n' | grep '^test-'); do | |
| kubectl logs -n "$ns" -l control-plane=controller-manager --tail=-1 --all-containers --prefix --timestamps > "/tmp/k8s-artifacts/operator-${ns}.log" 2>/dev/null || true | |
| done | |
| - name: Upload Kubernetes artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: bundle-e2e-logs | |
| path: /tmp/k8s-artifacts/ | |
| retention-days: 7 |