From 0075761012056e4e14fd371176a03fb672315094 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Feb 2026 04:35:38 +0000 Subject: [PATCH] Speed up e2e tests by removing Knative and parallelizing setup - Remove Setup Knative step: the project only uses knative.dev/pkg as a Go library for the controller framework, not Knative Serving/Eventing. This eliminates the slowest setup step entirely. - Create config-logging and config-observability ConfigMaps directly, which is all knative.dev/pkg/injection/sharedmain needs at runtime. - Deploy Gitea in parallel with ko controller builds instead of sequentially, so both can start at the same time. - Combine the "wait for controllers" and "wait for Gitea" steps into one. - Reduce Gitea readiness probe initialDelaySeconds from 10s to 3s and periodSeconds from 5s to 3s. - Reduce Gitea API wait loop sleep from 2s to 1s. - Reduce e2e test poll interval from 2s to 1s for faster feedback. https://claude.ai/code/session_018itccL4SXV3eD7iuPwLGYa --- .github/workflows/ci.yaml | 46 +++++++++++++++++++-------------------- test/e2e/e2e_test.go | 2 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9168ff7..adbb78d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -56,11 +56,6 @@ jobs: with: k8s-version: 1.33.x - - name: Setup Knative - uses: chainguard-dev/actions/setup-knative@main - with: - version: "1.15.0" - - name: Install ko uses: ko-build/setup-ko@v0.9 @@ -70,24 +65,20 @@ jobs: - name: Install CRDs run: kubectl apply -f config/crds/ - - name: Deploy RBAC + - name: Deploy RBAC and controller config run: | kubectl create namespace git-system || true kubectl apply -f config/rbac/ + # Create ConfigMaps required by knative.dev/pkg controller runtime. + kubectl create configmap config-logging -n git-system || true + kubectl create configmap config-observability -n git-system || true - - name: Deploy controllers with ko - run: ko apply -f config/deployments/ - - - name: Wait for controllers to be ready + - name: Deploy controllers and Gitea run: | - for deploy in push-controller sync-controller resolver-controller; do - echo "Waiting for ${deploy}..." - kubectl rollout status deployment/${deploy} \ - --namespace=git-system --timeout=120s - done + # Deploy controllers and Gitea in parallel. + ko apply -f config/deployments/ & + KO_PID=$! - - name: Deploy Gitea git server - run: | kubectl apply -f - <<'EOF' apiVersion: apps/v1 kind: Deployment @@ -119,8 +110,8 @@ jobs: httpGet: path: /api/v1/version port: 3000 - initialDelaySeconds: 10 - periodSeconds: 5 + initialDelaySeconds: 3 + periodSeconds: 3 resources: requests: cpu: 100m @@ -151,10 +142,19 @@ jobs: name: http EOF - - name: Wait for Gitea + # Wait for ko build to finish. + wait $KO_PID + + - name: Wait for controllers and Gitea run: | - kubectl rollout status deployment/gitea -n git-system --timeout=120s - for i in $(seq 1 30); do + # Wait for everything in parallel. + for deploy in push-controller sync-controller resolver-controller gitea; do + echo "Waiting for ${deploy}..." + kubectl rollout status deployment/${deploy} \ + --namespace=git-system --timeout=120s + done + # Verify Gitea API is responsive. + for i in $(seq 1 15); do if kubectl exec -n git-system deploy/gitea -- \ curl -sf http://localhost:3000/api/v1/version; then echo "" @@ -162,7 +162,7 @@ jobs: break fi echo "Waiting for Gitea API (attempt $i)..." - sleep 2 + sleep 1 done - name: Create Gitea admin user diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index 92ebc67..5e732b5 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -27,7 +27,7 @@ const ( giteaUsername = "testadmin" giteaPassword = "testpassword123" - pollInterval = 2 * time.Second + pollInterval = 1 * time.Second pollTimeout = 2 * time.Minute )