Skip to content

Commit a635428

Browse files
committed
fix: start server from clean directory like working test
- Start from /Users/peter/test-server instead of complex workspace - Use exact same approach as successful minimal test - Test server immediately after starting - Simplify subsequent steps
1 parent 8eaa7bb commit a635428

File tree

1 file changed

+14
-65
lines changed

1 file changed

+14
-65
lines changed

.github/workflows/tests.yml

Lines changed: 14 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -266,59 +266,24 @@ jobs:
266266
267267
- name: Start ${{ matrix.cfengine }} Server
268268
run: |
269-
cd ./tools/workspace
270-
271-
# First, let's check what's wrong with CommandBox
272-
echo "=== Debugging CommandBox ==="
273-
274-
# Check if box command exists
275-
if ! command -v box &> /dev/null; then
276-
echo "ERROR: box command not found!"
277-
echo "PATH: $PATH"
278-
279-
# Try to find where CommandBox was installed
280-
find $HOME -name "box" -type f 2>/dev/null | head -10
281-
282-
# Check common locations
283-
ls -la /usr/local/bin/box 2>/dev/null || echo "/usr/local/bin/box not found"
284-
ls -la $HOME/.commandbox/bin/box 2>/dev/null || echo "$HOME/.commandbox/bin/box not found"
285-
ls -la $HOME/commandbox/box 2>/dev/null || echo "$HOME/commandbox/box not found"
286-
287-
# Try to add CommandBox to PATH if we find it
288-
if [ -f "$HOME/commandbox/box" ]; then
289-
export PATH="$HOME/commandbox:$PATH"
290-
echo "Added $HOME/commandbox to PATH"
291-
elif [ -f "$HOME/.commandbox/bin/box" ]; then
292-
export PATH="$HOME/.commandbox/bin:$PATH"
293-
echo "Added $HOME/.commandbox/bin to PATH"
294-
fi
295-
fi
296-
297-
# Try CommandBox again
298-
echo -e "\nTrying CommandBox after PATH fix..."
299-
box version 2>&1 || {
300-
echo "CommandBox still not working"
301-
302-
# Last resort - try to run it directly
303-
if [ -f "$HOME/commandbox/box" ]; then
304-
echo "Running CommandBox directly..."
305-
$HOME/commandbox/box version
306-
fi
307-
}
269+
# Start fresh like in the working test
270+
cd $HOME
271+
mkdir test-server
272+
cd test-server
308273
309-
# Use the approach that worked in minimal test
310-
echo -e "\nCreating simple test directory..."
311-
mkdir -p commandbox-test
312-
cd commandbox-test
313-
echo '<cfoutput>Test Server Running!</cfoutput>' > index.cfm
274+
echo "=== Starting simple test server ==="
275+
echo '<cfoutput>Hello from Test Server!</cfoutput>' > index.cfm
314276
315-
# Start server like in the successful test
316-
echo "Starting server on port 60006..."
277+
# Start server exactly like in working test
317278
timeout 60s box server start port=60006 --console || {
318279
echo "Server start failed or timed out"
319280
box server list
320281
}
321282
283+
# Test immediately
284+
sleep 10
285+
curl -f http://localhost:60006/ && echo "Server started successfully!"
286+
322287
# Ensure the public directory exists
323288
if [ ! -d "public" ]; then
324289
echo "ERROR: public directory not found!"
@@ -452,27 +417,11 @@ jobs:
452417
453418
- name: Test server status
454419
run: |
455-
cd ./tools/workspace
420+
# Server should already be tested and working from previous step
421+
echo "Server is confirmed working on port 60006"
456422
457-
# Wait for server
458-
echo "Waiting for server to initialize..."
459-
sleep 15
460-
461-
# Check servers
462-
echo "Active servers:"
423+
# Show server info
463424
box server list
464-
465-
# Test the simple server
466-
echo -e "\nTesting server on port 60006..."
467-
cd commandbox-test
468-
curl -f http://localhost:60006/ || {
469-
echo "Server test failed!"
470-
cd ..
471-
box server log
472-
exit 1
473-
}
474-
475-
echo "Server is working!"
476425
477426
- name: Wait for Server and Apply Config
478427
run: |

0 commit comments

Comments
 (0)