Skip to content

Commit 0cb8a7a

Browse files
author
Agent
committed
Switch integration test deployment to httpd mode
Replace CTS_DEVELOPER_ENV=1 with a ConfigMap-mounted /etc/cts/config.py containing ProdConfiguration (AUTH_BACKEND=noauth, PostgreSQL URI). This makes init_config load ProdConfiguration via the file-based path. The default startup script hardcodes CTS_DEVELOPER_ENV=1, so override the container command to run httpd directly with a minimal httpd.conf supplied via the same ConfigMap at /etc/cts/httpd.conf. The httpd.conf uses ServerRoot /etc/httpd so that relative LoadModule paths resolve to /etc/httpd/modules/ (where Fedora's httpd RPM installs them). Writable locations are redirected: PidFile and Mutex go to /tmp/httpd/run (created at container start), and ErrorLog goes to /var/log/httpd which the Dockerfile already makes world-readable. Update all port references from 5005 to 8080: Service spec, containerPort, readinessProbe, livenessProbe, and CTS_URL in the run-tests step. Fixes #73 Generated-By: OpenCode (google-vertex-anthropic/claude-sonnet-4-6@default)
1 parent 7f048dc commit 0cb8a7a

1 file changed

Lines changed: 60 additions & 17 deletions

File tree

.tekton/integration-test-eaas.yaml

Lines changed: 60 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,40 @@ spec:
240240
echo "=========================================="
241241
echo "Image: $IMAGE"
242242
243+
# Create ConfigMap with production configuration and httpd config 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+
httpd.conf: |
257+
ServerRoot /etc/httpd
258+
PidFile /tmp/httpd/run/httpd.pid
259+
Mutex file:/tmp/httpd/run default
260+
261+
Listen 8080
262+
263+
LoadModule mpm_event_module modules/mod_mpm_event.so
264+
LoadModule authz_core_module modules/mod_authz_core.so
265+
LoadModule wsgi_module /usr/lib64/httpd/modules/mod_wsgi_python3.so
266+
267+
ErrorLog /var/log/httpd/error_log
268+
LogLevel warn
269+
270+
WSGIDaemonProcess cts python-path=/src processes=2 threads=5 \
271+
home=/src display-name=cts
272+
WSGIProcessGroup cts
273+
WSGIApplicationGroup %{GLOBAL}
274+
WSGIScriptAlias / /usr/share/cts/cts.wsgi
275+
EOF
276+
243277
# Deploy CTS
244278
kubectl apply -f - <<EOF
245279
apiVersion: v1
@@ -250,8 +284,8 @@ spec:
250284
app: cts
251285
spec:
252286
ports:
253-
- port: 5005
254-
targetPort: 5005
287+
- port: 8080
288+
targetPort: 8080
255289
name: http
256290
selector:
257291
app: cts
@@ -275,11 +309,6 @@ spec:
275309
initContainers:
276310
- name: run-migrations
277311
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"
283312
command:
284313
- /bin/bash
285314
- -c
@@ -289,16 +318,22 @@ spec:
289318
cd /src
290319
cts-manager db upgrade
291320
echo "Migrations completed successfully"
321+
volumeMounts:
322+
- name: cts-config
323+
mountPath: /etc/cts
324+
readOnly: true
292325
containers:
293326
- name: cts
294327
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"
328+
command:
329+
- /bin/bash
330+
- -c
331+
- |
332+
set -e
333+
mkdir -p /tmp/httpd/run
334+
exec httpd -DFOREGROUND -f /etc/cts/httpd.conf
300335
ports:
301-
- containerPort: 5005
336+
- containerPort: 8080
302337
resources:
303338
requests:
304339
memory: "256Mi"
@@ -309,18 +344,26 @@ spec:
309344
readinessProbe:
310345
httpGet:
311346
path: /api/1/
312-
port: 5005
347+
port: 8080
313348
initialDelaySeconds: 15
314349
periodSeconds: 5
315350
timeoutSeconds: 5
316351
failureThreshold: 12
317352
livenessProbe:
318353
httpGet:
319354
path: /api/1/
320-
port: 5005
355+
port: 8080
321356
initialDelaySeconds: 30
322357
periodSeconds: 10
323358
timeoutSeconds: 5
359+
volumeMounts:
360+
- name: cts-config
361+
mountPath: /etc/cts
362+
readOnly: true
363+
volumes:
364+
- name: cts-config
365+
configMap:
366+
name: cts-config
324367
EOF
325368
326369
echo "Waiting for CTS service to be ready..."
@@ -425,7 +468,7 @@ spec:
425468
426469
echo ""
427470
echo "Running tests in pod..."
428-
echo "CTS URL: http://cts:5005"
471+
echo "CTS URL: http://cts:8080"
429472
echo ""
430473
431474
# Run the tests - temporarily disable exit-on-error to capture result
@@ -448,7 +491,7 @@ spec:
448491
449492
echo ''
450493
echo 'Running pytest...'
451-
CTS_URL=http://cts:5005 python3 -m pytest tests/test_integration_api.py -v -s -o addopts=
494+
CTS_URL=http://cts:8080 python3 -m pytest tests/test_integration_api.py -v -s -o addopts=
452495
"
453496
TEST_RESULT=$?
454497
set -e

0 commit comments

Comments
 (0)