CI / CI (pull_request) Failing after 50s
FIXES: - Remove stale files: k8s/argocd-apps/, k8s/tekton/base/, overlays/ (Tekton infra is in homelab repo, not here) - Fix step.resources → step.computeResources (Tekton v1 API) - Fix Task: use curl sidecar pattern instead of distroless image (distroless has no shell/curl/go) - Fix routing: use X-Service + X-Resource headers, not path-based - Extract test script to scripts/integration-test.sh (ConfigMap mount) - Install kubectl in CI runner (was missing) - Prune README to essentials TASK ARCHITECTURE: sidecar: gateway image (mounts config secret, runs on localhost) step: curlimages/curl (runs integration-test.sh from ConfigMap) TEST COVERAGE: health, header validation, memory, s3, sqs, workflow, iam
59 lines
1.5 KiB
Markdown
59 lines
1.5 KiB
Markdown
# Tekton Integration Tests
|
|
|
|
Curl-based integration tests for the API gateway, orchestrated by Tekton.
|
|
|
|
## How It Works
|
|
|
|
```
|
|
CI pushes image:sha → creates PipelineRun → Tekton spins up gateway sidecar
|
|
→ runs curl tests → reports pass/fail → CI promotes to :latest if pass
|
|
```
|
|
|
|
The Task runs the gateway image as a **sidecar** (same pod, localhost),
|
|
then executes `scripts/integration-test.sh` which tests every adapter
|
|
via `X-Service` + `X-Resource` header routing.
|
|
|
|
## Files
|
|
|
|
| File | Purpose |
|
|
|------|---------|
|
|
| `task-integration-test.yaml` | Task: sidecar gateway + curl test step |
|
|
| `pipeline-integration-test.yaml` | Pipeline: wraps the Task |
|
|
| `scripts/integration-test.sh` | Test script (mounted as ConfigMap) |
|
|
| `kustomization.yaml` | Generates ConfigMap from script |
|
|
|
|
## Manual Run
|
|
|
|
```bash
|
|
kubectl apply -k k8s/tekton/
|
|
kubectl create -f - <<'EOF'
|
|
apiVersion: tekton.dev/v1
|
|
kind: PipelineRun
|
|
metadata:
|
|
name: integration-test-manual
|
|
namespace: api
|
|
spec:
|
|
pipelineRef:
|
|
name: integration-test-pipeline
|
|
params:
|
|
- name: image
|
|
value: forgejo.riotpiao.com/rock/api-gateway:latest
|
|
EOF
|
|
|
|
# Watch
|
|
kubectl logs -f -n api pipelinerun/integration-test-manual -c step-run-tests
|
|
```
|
|
|
|
## Updating Tests
|
|
|
|
Edit `scripts/integration-test.sh`, then:
|
|
|
|
```bash
|
|
kubectl apply -k k8s/tekton/ # recreates ConfigMap
|
|
```
|
|
|
|
## Tekton Infrastructure
|
|
|
|
Tekton Pipelines is installed in `~/workplace/homelab` via ArgoCD
|
|
(`k8s/argocd/apps/06-ci-cd.yaml` → vendored `k8s/infra/tekton/release.yaml`).
|