1
0
Fork 0
mirror of https://github.com/imjasonh/git-k8s synced 2026-07-09 07:06:52 +00:00

Add comprehensive e2e tests for repo-watcher-controller

Tests cover the key behaviors of the repo-watcher:
- Branch discovery: auto-creates GitBranch CRDs from remote refs
- Owner references: created branches correctly reference GitRepository
- New branch detection: branches added on Gitea are picked up
- Commit update detection: new pushes to Gitea update headCommit
- Branch deletion: branches removed from Gitea trigger CRD deletion
- Multiple branches: all branches on a repo are discovered
- LastFetchTime: status is updated and advances on each poll
- Labels: repository label is set on created branches
- Slash branch names: feature/foo naming handled correctly

Also adds shared e2e helpers for Gitea branch/file operations and
updates CI workflow to deploy and monitor the repo-watcher-controller.

https://claude.ai/code/session_01P7xfBqARU5DFS8QJ4uDPVj
This commit is contained in:
Claude 2026-02-28 14:15:28 +00:00
parent ee281430b6
commit 6f803bf10e
No known key found for this signature in database
3 changed files with 547 additions and 2 deletions

View file

@ -27,6 +27,7 @@ jobs:
go build ./cmd/push-controller/
go build ./cmd/sync-controller/
go build ./cmd/resolver-controller/
go build ./cmd/repo-watcher-controller/
- name: Test
run: go test ./...
@ -148,7 +149,7 @@ jobs:
- name: Wait for controllers and Gitea
run: |
# Wait for everything in parallel.
for deploy in push-controller sync-controller resolver-controller gitea; do
for deploy in push-controller sync-controller resolver-controller repo-watcher-controller gitea; do
echo "Waiting for ${deploy}..."
kubectl rollout status deployment/${deploy} \
--namespace=git-system --timeout=120s
@ -198,7 +199,7 @@ jobs:
if: ${{ failure() }}
run: |
echo "=== Controller logs ==="
for ctrl in push-controller sync-controller resolver-controller; do
for ctrl in push-controller sync-controller resolver-controller repo-watcher-controller; do
echo "--- ${ctrl} ---"
kubectl logs -n git-system deploy/${ctrl} --tail=50 2>/dev/null || true
done