1
0
Fork 0
mirror of https://github.com/imjasonh/git-k8s synced 2026-07-22 16:01:39 +00:00

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
This commit is contained in:
Claude 2026-02-28 04:35:38 +00:00
parent 9d5cd83734
commit 0075761012
No known key found for this signature in database
2 changed files with 24 additions and 24 deletions

View file

@ -56,11 +56,6 @@ jobs:
with: with:
k8s-version: 1.33.x k8s-version: 1.33.x
- name: Setup Knative
uses: chainguard-dev/actions/setup-knative@main
with:
version: "1.15.0"
- name: Install ko - name: Install ko
uses: ko-build/setup-ko@v0.9 uses: ko-build/setup-ko@v0.9
@ -70,24 +65,20 @@ jobs:
- name: Install CRDs - name: Install CRDs
run: kubectl apply -f config/crds/ run: kubectl apply -f config/crds/
- name: Deploy RBAC - name: Deploy RBAC and controller config
run: | run: |
kubectl create namespace git-system || true kubectl create namespace git-system || true
kubectl apply -f config/rbac/ 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 - name: Deploy controllers and Gitea
run: ko apply -f config/deployments/
- name: Wait for controllers to be ready
run: | run: |
for deploy in push-controller sync-controller resolver-controller; do # Deploy controllers and Gitea in parallel.
echo "Waiting for ${deploy}..." ko apply -f config/deployments/ &
kubectl rollout status deployment/${deploy} \ KO_PID=$!
--namespace=git-system --timeout=120s
done
- name: Deploy Gitea git server
run: |
kubectl apply -f - <<'EOF' kubectl apply -f - <<'EOF'
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
@ -119,8 +110,8 @@ jobs:
httpGet: httpGet:
path: /api/v1/version path: /api/v1/version
port: 3000 port: 3000
initialDelaySeconds: 10 initialDelaySeconds: 3
periodSeconds: 5 periodSeconds: 3
resources: resources:
requests: requests:
cpu: 100m cpu: 100m
@ -151,10 +142,19 @@ jobs:
name: http name: http
EOF EOF
- name: Wait for Gitea # Wait for ko build to finish.
wait $KO_PID
- name: Wait for controllers and Gitea
run: | run: |
kubectl rollout status deployment/gitea -n git-system --timeout=120s # Wait for everything in parallel.
for i in $(seq 1 30); do 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 -- \ if kubectl exec -n git-system deploy/gitea -- \
curl -sf http://localhost:3000/api/v1/version; then curl -sf http://localhost:3000/api/v1/version; then
echo "" echo ""
@ -162,7 +162,7 @@ jobs:
break break
fi fi
echo "Waiting for Gitea API (attempt $i)..." echo "Waiting for Gitea API (attempt $i)..."
sleep 2 sleep 1
done done
- name: Create Gitea admin user - name: Create Gitea admin user

View file

@ -27,7 +27,7 @@ const (
giteaUsername = "testadmin" giteaUsername = "testadmin"
giteaPassword = "testpassword123" giteaPassword = "testpassword123"
pollInterval = 2 * time.Second pollInterval = 1 * time.Second
pollTimeout = 2 * time.Minute pollTimeout = 2 * time.Minute
) )