1
0
Fork 0
mirror of https://github.com/imjasonh/git-k8s synced 2026-07-13 08:57:00 +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:
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