2026-09-13 14:28:51 +09:00
|
|
|
apiVersion: tekton.dev/v1
|
|
|
|
|
kind: Task
|
|
|
|
|
metadata:
|
|
|
|
|
name: integration-test
|
|
|
|
|
namespace: api
|
|
|
|
|
labels:
|
|
|
|
|
app: api-gateway
|
|
|
|
|
component: testing
|
|
|
|
|
spec:
|
2026-09-13 21:12:15 +09:00
|
|
|
description: >
|
|
|
|
|
Spin up a gateway pod from the given image as a sidecar,
|
|
|
|
|
run curl-based integration tests, report pass/fail.
|
2026-09-13 14:28:51 +09:00
|
|
|
params:
|
|
|
|
|
- name: image
|
|
|
|
|
type: string
|
2026-09-13 21:12:15 +09:00
|
|
|
description: "Container image to test (repo:tag)"
|
|
|
|
|
- name: gateway-port
|
2026-09-13 14:28:51 +09:00
|
|
|
type: string
|
2026-09-13 21:12:15 +09:00
|
|
|
default: "8080"
|
2026-09-13 14:28:51 +09:00
|
|
|
results:
|
|
|
|
|
- name: result
|
|
|
|
|
type: string
|
2026-09-13 21:12:15 +09:00
|
|
|
- name: summary
|
2026-09-13 14:28:51 +09:00
|
|
|
type: string
|
2026-09-13 21:12:15 +09:00
|
|
|
|
|
|
|
|
sidecars:
|
|
|
|
|
- name: gateway
|
|
|
|
|
image: $(params.image)
|
|
|
|
|
env:
|
|
|
|
|
- name: LISTEN_ADDR
|
|
|
|
|
value: "0.0.0.0:$(params.gateway-port)"
|
|
|
|
|
- name: CONFIG_PATH
|
|
|
|
|
value: /etc/gateway/config.yaml
|
|
|
|
|
- name: LOG_LEVEL
|
|
|
|
|
value: info
|
|
|
|
|
- name: AUTH_CLIENT_SECRET
|
|
|
|
|
valueFrom:
|
|
|
|
|
secretKeyRef:
|
|
|
|
|
name: api-gw-client-secret
|
|
|
|
|
key: client-secret
|
|
|
|
|
optional: true
|
|
|
|
|
volumeMounts:
|
|
|
|
|
- name: gateway-config
|
|
|
|
|
mountPath: /etc/gateway
|
|
|
|
|
readOnly: true
|
|
|
|
|
|
2026-09-13 14:28:51 +09:00
|
|
|
steps:
|
|
|
|
|
- name: run-tests
|
2026-09-13 21:12:15 +09:00
|
|
|
image: curlimages/curl:8.13.0
|
2026-09-13 14:28:51 +09:00
|
|
|
env:
|
2026-09-13 21:12:15 +09:00
|
|
|
- name: GW
|
|
|
|
|
value: "http://localhost:$(params.gateway-port)"
|
|
|
|
|
- name: RESULTS_DIR
|
|
|
|
|
value: /tekton/results
|
|
|
|
|
command: ["sh", "/scripts/integration-test.sh"]
|
2026-09-13 14:28:51 +09:00
|
|
|
volumeMounts:
|
2026-09-13 21:12:15 +09:00
|
|
|
- name: test-script
|
|
|
|
|
mountPath: /scripts
|
|
|
|
|
readOnly: true
|
|
|
|
|
computeResources:
|
2026-09-13 14:28:51 +09:00
|
|
|
requests:
|
2026-09-13 21:12:15 +09:00
|
|
|
cpu: 100m
|
|
|
|
|
memory: 64Mi
|
2026-09-13 14:28:51 +09:00
|
|
|
limits:
|
2026-09-13 21:12:15 +09:00
|
|
|
cpu: 200m
|
|
|
|
|
memory: 128Mi
|
|
|
|
|
|
2026-09-13 14:28:51 +09:00
|
|
|
volumes:
|
2026-09-13 21:12:15 +09:00
|
|
|
- name: gateway-config
|
|
|
|
|
secret:
|
|
|
|
|
secretName: api-gateway-config
|
|
|
|
|
- name: test-script
|
|
|
|
|
configMap:
|
|
|
|
|
name: integration-test-script
|
|
|
|
|
defaultMode: 0755
|