1
0
Fork 0
mirror of https://github.com/imjasonh/git-k8s synced 2026-07-09 15:16:56 +00:00
Commit graph

4 commits

Author SHA1 Message Date
Claude
6f803bf10e
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
2026-02-28 14:15:28 +00:00
Claude
0075761012
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
2026-02-28 04:35:38 +00:00
Claude
765007bb87
Fix stale resourceVersion bug in push controller
The push controller updates status to InProgress then later to
Succeeded/Failed. The first UpdateStatus call returns a new object with
an updated resourceVersion, but the code was discarding it. Subsequent
status updates used the stale resourceVersion, causing 409 Conflict
errors and an infinite retry loop where transactions never reached a
terminal phase.

Fix: capture the returned object from the InProgress UpdateStatus so
subsequent calls use the correct resourceVersion.

Also adds better timeout diagnostics in e2e test helpers.

https://claude.ai/code/session_01QfFzqKQUsxxBsiZUhuJ3pG
2026-02-28 04:09:56 +00:00
Claude
32137c3bc4
Rewrite e2e tests in Go, replace bash-in-YAML test steps
Move all e2e test logic from bash steps in ci.yaml into Go test files
under test/e2e/. CI now sets up infrastructure (KinD, Knative, CRDs,
controllers, Gitea) then runs `go test -tags=e2e ./test/e2e/`.

Benefits:
- Tests run concurrently via t.Parallel()
- No more bash-in-YAML maintenance burden
- Each test creates its own isolated resources with cleanup
- Proper Go test output with -v
- Build-tagged so `go test ./...` skips them

Tests:
- TestPushTransaction: push main to a new branch, verify on git server
- TestPushTransactionMultipleRefSpecs: push to two branches at once
- TestRepoSync: create two repos, set up GitRepoSync, verify controller

https://claude.ai/code/session_01QfFzqKQUsxxBsiZUhuJ3pG
2026-02-28 02:04:29 +00:00