Skip to content

Commit f70a6c2

Browse files
author
Agent
committed
Switch integration test deployment to httpd mode
Replace CTS_DEVELOPER_ENV=1 (Flask dev server on port 5005) with a production-like httpd setup on port 8080. A cts-config ConfigMap is created with two files: - /etc/cts/config.py: ProdConfiguration (AUTH_BACKEND=noauth, PostgreSQL URI), loaded by init_config when CTS_DEVELOPER_ENV is absent. - /etc/cts/httpd.conf: Apache httpd + mod_wsgi config matching the production template (ServerRoot /etc/httpd, Include conf.modules.d/*, WSGIDaemonProcess, WSGIScriptAlias). PidFile and DefaultRuntimeDir point to /tmp so httpd can write them as a non-root user under OpenShift's restricted-v2 SCC. Logs go to /dev/stderr and /dev/stdout. The main container command is overridden to run httpd -DFOREGROUND directly, bypassing start_cts_from_here which unconditionally sets CTS_DEVELOPER_ENV=1. Port references updated from 5005 to 8080 throughout (Service, containerPort, readiness/liveness probes, CTS_URL). Fixes #73 Generated-By: OpenCode (google-vertex-anthropic/claude-sonnet-4-6@default)
1 parent 7f048dc commit f70a6c2

1 file changed

Lines changed: 61 additions & 17 deletions

File tree

.tekton/integration-test-eaas.yaml

Lines changed: 61 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,44 @@ 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.pid
259+
Listen 0.0.0.0:8080 http
260+
User apache
261+
Group apache
262+
DocumentRoot "/var/www/html"
263+
ErrorLog /dev/stderr
264+
TransferLog /dev/stdout
265+
LogLevel warn
266+
TypesConfig /etc/mime.types
267+
DefaultRuntimeDir /tmp
268+
269+
Include conf.modules.d/*.conf
270+
271+
WSGISocketPrefix /tmp/wsgi
272+
WSGIDaemonProcess cts threads=5 home=/usr/share/cts
273+
WSGIScriptAlias / /usr/share/cts/cts.wsgi
274+
275+
<Directory /usr/share/cts>
276+
WSGIProcessGroup cts
277+
WSGIApplicationGroup %{GLOBAL}
278+
</Directory>
279+
EOF
280+
243281
# Deploy CTS
244282
kubectl apply -f - <<EOF
245283
apiVersion: v1
@@ -250,8 +288,8 @@ spec:
250288
app: cts
251289
spec:
252290
ports:
253-
- port: 5005
254-
targetPort: 5005
291+
- port: 8080
292+
targetPort: 8080
255293
name: http
256294
selector:
257295
app: cts
@@ -275,11 +313,6 @@ spec:
275313
initContainers:
276314
- name: run-migrations
277315
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"
283316
command:
284317
- /bin/bash
285318
- -c
@@ -289,16 +322,19 @@ spec:
289322
cd /src
290323
cts-manager db upgrade
291324
echo "Migrations completed successfully"
325+
volumeMounts:
326+
- name: cts-config
327+
mountPath: /etc/cts
328+
readOnly: true
292329
containers:
293330
- name: cts
294331
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"
332+
command:
333+
- /bin/bash
334+
- -c
335+
- exec httpd -DFOREGROUND -f /etc/cts/httpd.conf
300336
ports:
301-
- containerPort: 5005
337+
- containerPort: 8080
302338
resources:
303339
requests:
304340
memory: "256Mi"
@@ -309,18 +345,26 @@ spec:
309345
readinessProbe:
310346
httpGet:
311347
path: /api/1/
312-
port: 5005
348+
port: 8080
313349
initialDelaySeconds: 15
314350
periodSeconds: 5
315351
timeoutSeconds: 5
316352
failureThreshold: 12
317353
livenessProbe:
318354
httpGet:
319355
path: /api/1/
320-
port: 5005
356+
port: 8080
321357
initialDelaySeconds: 30
322358
periodSeconds: 10
323359
timeoutSeconds: 5
360+
volumeMounts:
361+
- name: cts-config
362+
mountPath: /etc/cts
363+
readOnly: true
364+
volumes:
365+
- name: cts-config
366+
configMap:
367+
name: cts-config
324368
EOF
325369
326370
echo "Waiting for CTS service to be ready..."
@@ -425,7 +469,7 @@ spec:
425469
426470
echo ""
427471
echo "Running tests in pod..."
428-
echo "CTS URL: http://cts:5005"
472+
echo "CTS URL: http://cts:8080"
429473
echo ""
430474
431475
# Run the tests - temporarily disable exit-on-error to capture result
@@ -448,7 +492,7 @@ spec:
448492
449493
echo ''
450494
echo 'Running pytest...'
451-
CTS_URL=http://cts:5005 python3 -m pytest tests/test_integration_api.py -v -s -o addopts=
495+
CTS_URL=http://cts:8080 python3 -m pytest tests/test_integration_api.py -v -s -o addopts=
452496
"
453497
TEST_RESULT=$?
454498
set -e

0 commit comments

Comments
 (0)