From 5d6446572c832107ead53f2ec522cfbb5fe4c4eb Mon Sep 17 00:00:00 2001 From: chrislusf Date: Fri, 5 Dec 2025 18:50:04 -0800 Subject: ci: add CSI integration test workflow - Sets up kind cluster - Deploys SeaweedFS server - Deploys CSI driver with mount service - Creates StorageClass and PVC - Runs functional tests (write/read) - Collects logs on failure for debugging --- .github/workflows/integration_test.yaml | 228 ++++++++++++++++++++++++++++++++ 1 file changed, 228 insertions(+) create mode 100644 .github/workflows/integration_test.yaml diff --git a/.github/workflows/integration_test.yaml b/.github/workflows/integration_test.yaml new file mode 100644 index 0000000..8cc7cdd --- /dev/null +++ b/.github/workflows/integration_test.yaml @@ -0,0 +1,228 @@ +name: CSI Integration Tests + +on: + push: + branches: [master] + pull_request: + workflow_dispatch: + +jobs: + integration-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.25' + + - name: Build CSI driver + run: | + go build -o _output/seaweedfs-csi-driver ./cmd/seaweedfs-csi-driver + go build -o _output/seaweedfs-mount ./cmd/seaweedfs-mount + + - name: Create kind cluster + uses: helm/kind-action@v1.10.0 + with: + cluster_name: csi-test + + - name: Build and load Docker images + run: | + # Build CSI driver image + docker build -t seaweedfs-csi-driver:test -f cmd/seaweedfs-csi-driver/Dockerfile . + kind load docker-image seaweedfs-csi-driver:test --name csi-test + + # Build mount service image + docker build -t seaweedfs-mount:test -f cmd/seaweedfs-mount/Dockerfile . + kind load docker-image seaweedfs-mount:test --name csi-test + + - name: Deploy SeaweedFS + run: | + # Deploy SeaweedFS using a simple manifest + kubectl apply -f - < /data/test.txt' + + # Test read + kubectl exec test-pod -- cat /data/test.txt | grep "Hello SeaweedFS CSI" + + # Test file listing + kubectl exec test-pod -- ls -la /data/ + + echo "✅ Functional test passed!" + + - name: Cleanup + if: always() + run: | + kubectl delete pod test-pod --ignore-not-found + kubectl delete pvc test-pvc --ignore-not-found + + - name: Collect logs on failure + if: failure() + run: | + echo "=== CSI Controller Logs ===" + kubectl logs -n seaweedfs-csi -l app=csi-seaweedfs-controller --tail=200 || true + echo "=== CSI Node Logs ===" + kubectl logs -n seaweedfs-csi -l app=csi-seaweedfs-node --tail=200 || true + echo "=== Mount Service Logs ===" + kubectl logs -n seaweedfs-csi -l app=seaweedfs-mount --tail=200 || true + echo "=== SeaweedFS Logs ===" + kubectl logs -n seaweedfs -l app=seaweedfs --tail=200 || true + echo "=== All Pods ===" + kubectl get pods -A + echo "=== Events ===" + kubectl get events --sort-by='.lastTimestamp' | tail -50 + -- cgit v1.2.3