Skip to content

Commit d94949d

Browse files
author
Agent
committed
Switch integration test deployment to httpd mode
- Replace CTS_DEVELOPER_ENV=1 with a ConfigMap mounted at /etc/cts/config.py containing a ProdConfiguration (AUTH_BACKEND=noauth, PostgreSQL URI) - Mount the ConfigMap in both the run-migrations init container and the main cts container so init_config loads ProdConfiguration from the file - Update all port references from 5005 (Flask dev server) to 8080 (httpd) in the Service spec, containerPort, readinessProbe, livenessProbe, and CTS_URL used by the test runner Closes #73 Generated-By: OpenCode (google-vertex-anthropic/claude-sonnet-4-6@default)
1 parent 7f048dc commit d94949d

1 file changed

Lines changed: 34 additions & 17 deletions

File tree

.tekton/integration-test-eaas.yaml

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,21 @@ spec:
240240
echo "=========================================="
241241
echo "Image: $IMAGE"
242242
243+
# Create ConfigMap with production configuration for CTS
244+
kubectl apply -f - <<EOF
245+
apiVersion: v1
246+
kind: ConfigMap
247+
metadata:
248+
name: cts-config
249+
data:
250+
config.py: |
251+
from conf.config import BaseConfiguration
252+
253+
class ProdConfiguration(BaseConfiguration):
254+
AUTH_BACKEND = "noauth"
255+
SQLALCHEMY_DATABASE_URI = "postgresql://cts:cts-test@cts-db:5432/cts"
256+
EOF
257+
243258
# Deploy CTS
244259
kubectl apply -f - <<EOF
245260
apiVersion: v1
@@ -250,8 +265,8 @@ spec:
250265
app: cts
251266
spec:
252267
ports:
253-
- port: 5005
254-
targetPort: 5005
268+
- port: 8080
269+
targetPort: 8080
255270
name: http
256271
selector:
257272
app: cts
@@ -275,11 +290,6 @@ spec:
275290
initContainers:
276291
- name: run-migrations
277292
image: $IMAGE
278-
env:
279-
- name: CTS_DEVELOPER_ENV
280-
value: "1"
281-
- name: SQLALCHEMY_DATABASE_URI
282-
value: "postgresql://cts:cts-test@cts-db:5432/cts"
283293
command:
284294
- /bin/bash
285295
- -c
@@ -289,16 +299,15 @@ spec:
289299
cd /src
290300
cts-manager db upgrade
291301
echo "Migrations completed successfully"
302+
volumeMounts:
303+
- name: cts-config
304+
mountPath: /etc/cts
305+
readOnly: true
292306
containers:
293307
- name: cts
294308
image: $IMAGE
295-
env:
296-
- name: CTS_DEVELOPER_ENV
297-
value: "1"
298-
- name: SQLALCHEMY_DATABASE_URI
299-
value: "postgresql://cts:cts-test@cts-db:5432/cts"
300309
ports:
301-
- containerPort: 5005
310+
- containerPort: 8080
302311
resources:
303312
requests:
304313
memory: "256Mi"
@@ -309,18 +318,26 @@ spec:
309318
readinessProbe:
310319
httpGet:
311320
path: /api/1/
312-
port: 5005
321+
port: 8080
313322
initialDelaySeconds: 15
314323
periodSeconds: 5
315324
timeoutSeconds: 5
316325
failureThreshold: 12
317326
livenessProbe:
318327
httpGet:
319328
path: /api/1/
320-
port: 5005
329+
port: 8080
321330
initialDelaySeconds: 30
322331
periodSeconds: 10
323332
timeoutSeconds: 5
333+
volumeMounts:
334+
- name: cts-config
335+
mountPath: /etc/cts
336+
readOnly: true
337+
volumes:
338+
- name: cts-config
339+
configMap:
340+
name: cts-config
324341
EOF
325342
326343
echo "Waiting for CTS service to be ready..."
@@ -425,7 +442,7 @@ spec:
425442
426443
echo ""
427444
echo "Running tests in pod..."
428-
echo "CTS URL: http://cts:5005"
445+
echo "CTS URL: http://cts:8080"
429446
echo ""
430447
431448
# Run the tests - temporarily disable exit-on-error to capture result
@@ -448,7 +465,7 @@ spec:
448465
449466
echo ''
450467
echo 'Running pytest...'
451-
CTS_URL=http://cts:5005 python3 -m pytest tests/test_integration_api.py -v -s -o addopts=
468+
CTS_URL=http://cts:8080 python3 -m pytest tests/test_integration_api.py -v -s -o addopts=
452469
"
453470
TEST_RESULT=$?
454471
set -e

0 commit comments

Comments
 (0)