Skip to content

Commit 5c2254a

Browse files
committed
Add stress tests hitting extension, admin, and resource endpoints in parallel
1 parent f175dda commit 5c2254a

File tree

1 file changed

+90
-1
lines changed

1 file changed

+90
-1
lines changed

.github/workflows/deployment-tests.yml

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,22 @@ jobs:
149149
source: "build"
150150
artifactName: "7.1-native"
151151
delay: 10
152+
# Stress tests - hit multiple endpoints in parallel immediately
153+
- name: "7.0-snapshot-stress"
154+
source: "download"
155+
luceeVersion: "7.0/snapshot/jar"
156+
delay: 0
157+
testMode: "stress"
158+
- name: "6.2-snapshot-stress"
159+
source: "download"
160+
luceeVersion: "6.2/snapshot/jar"
161+
delay: 0
162+
testMode: "stress"
163+
- name: "7.1-native-stress"
164+
source: "build"
165+
artifactName: "7.1-native"
166+
delay: 0
167+
testMode: "stress"
152168
steps:
153169
- name: Checkout
154170
uses: actions/checkout@v4
@@ -240,7 +256,80 @@ jobs:
240256
echo "Making immediate request (no delay)..."
241257
fi
242258
243-
# Try up to 60 times with 1 second between attempts
259+
# Stress test mode - hit multiple endpoints in parallel
260+
if [ "${{ matrix.testMode }}" = "stress" ]; then
261+
echo "=== STRESS TEST MODE ==="
262+
echo "Waiting for Tomcat to accept connections..."
263+
for i in {1..60}; do
264+
if curl -s -o /dev/null http://127.0.0.1:8888/ 2>/dev/null; then
265+
echo "Tomcat responding after $i seconds"
266+
break
267+
fi
268+
sleep 1
269+
done
270+
271+
echo "Firing parallel requests to all endpoints..."
272+
# Hit all endpoints in parallel
273+
curl -s -o /tmp/ext.txt -w "%{http_code}" http://127.0.0.1:8888/test-slow-startup.cfm > /tmp/ext_code.txt 2>&1 &
274+
PID1=$!
275+
curl -s -o /tmp/admin.txt -w "%{http_code}" http://127.0.0.1:8888/lucee/admin/index.cfm > /tmp/admin_code.txt 2>&1 &
276+
PID2=$!
277+
curl -s -o /tmp/res.txt -w "%{http_code}" http://127.0.0.1:8888/lucee/res/js/admin.js.cfm > /tmp/res_code.txt 2>&1 &
278+
PID3=$!
279+
wait $PID1 $PID2 $PID3
280+
281+
EXT_CODE=$(cat /tmp/ext_code.txt)
282+
ADMIN_CODE=$(cat /tmp/admin_code.txt)
283+
RES_CODE=$(cat /tmp/res_code.txt)
284+
285+
echo "Extension endpoint: $EXT_CODE"
286+
echo "Admin endpoint: $ADMIN_CODE"
287+
echo "Resource endpoint: $RES_CODE"
288+
289+
FAILED=0
290+
echo "### Stress Test Results" >> $GITHUB_STEP_SUMMARY
291+
echo "" >> $GITHUB_STEP_SUMMARY
292+
293+
if [ "$EXT_CODE" = "200" ]; then
294+
echo "✅ Extension: PASSED" >> $GITHUB_STEP_SUMMARY
295+
else
296+
echo "❌ Extension: FAILED ($EXT_CODE)" >> $GITHUB_STEP_SUMMARY
297+
echo '```' >> $GITHUB_STEP_SUMMARY
298+
cat /tmp/ext.txt >> $GITHUB_STEP_SUMMARY 2>/dev/null || echo "(no response)" >> $GITHUB_STEP_SUMMARY
299+
echo '```' >> $GITHUB_STEP_SUMMARY
300+
FAILED=1
301+
fi
302+
303+
if [ "$ADMIN_CODE" = "200" ]; then
304+
echo "✅ Admin: PASSED" >> $GITHUB_STEP_SUMMARY
305+
else
306+
echo "❌ Admin: FAILED ($ADMIN_CODE)" >> $GITHUB_STEP_SUMMARY
307+
echo '```' >> $GITHUB_STEP_SUMMARY
308+
cat /tmp/admin.txt >> $GITHUB_STEP_SUMMARY 2>/dev/null || echo "(no response)" >> $GITHUB_STEP_SUMMARY
309+
echo '```' >> $GITHUB_STEP_SUMMARY
310+
FAILED=1
311+
fi
312+
313+
if [ "$RES_CODE" = "200" ]; then
314+
echo "✅ Resource: PASSED" >> $GITHUB_STEP_SUMMARY
315+
else
316+
echo "❌ Resource: FAILED ($RES_CODE)" >> $GITHUB_STEP_SUMMARY
317+
echo '```' >> $GITHUB_STEP_SUMMARY
318+
cat /tmp/res.txt >> $GITHUB_STEP_SUMMARY 2>/dev/null || echo "(no response)" >> $GITHUB_STEP_SUMMARY
319+
echo '```' >> $GITHUB_STEP_SUMMARY
320+
FAILED=1
321+
fi
322+
323+
if [ "$FAILED" = "1" ]; then
324+
echo "STRESS TEST FAILED"
325+
exit 1
326+
else
327+
echo "STRESS TEST PASSED - all endpoints responded 200"
328+
exit 0
329+
fi
330+
fi
331+
332+
# Normal test mode - single endpoint
244333
for i in {1..60}; do
245334
echo "Attempt $i..."
246335
HTTP_CODE=$(curl -s -o /tmp/response.txt -w "%{http_code}" http://127.0.0.1:8888/test-slow-startup.cfm 2>/dev/null) || HTTP_CODE="000"

0 commit comments

Comments
 (0)