Skip to content

Commit 48a17f1

Browse files
committed
fix: Verify resize by checking actual droplet size
- Use doctl to check actual droplet size instead of logs - Resize messages are in GH Actions output, not VPS logs - Removes duplicate size check - More reliable verification method
1 parent 5c5c1e6 commit 48a17f1

1 file changed

Lines changed: 12 additions & 38 deletions

File tree

β€Ž.github/workflows/integration-test.ymlβ€Ž

Lines changed: 12 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -280,32 +280,19 @@ jobs:
280280
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
281281
chmod 600 ~/.ssh/id_rsa
282282
283-
# Download deployment log to check for resize
284-
echo "πŸ“₯ Downloading deployment log..."
285-
scp -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa root@${VPS_IP}:/var/log/setup-dc.log ./upgrade-test.log || echo "Could not download log"
286-
287-
# Check if resize was detected and executed
288-
if [ -f ./upgrade-test.log ]; then
289-
echo "πŸ“‹ Checking for droplet resize indicators..."
290-
if grep -q "Droplet size mismatch detected" ./upgrade-test.log; then
291-
echo "βœ… PASS: Droplet size mismatch was detected"
292-
293-
if grep -q "Droplet resized successfully" ./upgrade-test.log; then
294-
echo "βœ… PASS: Droplet resize completed successfully"
295-
else
296-
echo "❌ FAIL: Droplet resize did not complete"
297-
echo "πŸ“‹ Log excerpt:"
298-
grep -A 5 -B 5 "resize" ./upgrade-test.log || echo "No resize info found"
299-
exit 1
300-
fi
301-
else
302-
echo "❌ FAIL: No resize detection found in logs"
303-
echo "πŸ“‹ Checking deploy.sh log for resize-related messages..."
304-
grep -i "resize\|size\|checking if droplet" ./upgrade-test.log | head -20 || echo "No size-related messages found"
305-
exit 1
306-
fi
283+
# Verify droplet was actually resized via doctl
284+
echo "πŸ” Verifying droplet size via doctl..."
285+
doctl auth init --access-token "${{ secrets.DIGITALOCEAN_TOKEN }}"
286+
ACTUAL_SIZE=$(doctl compute droplet get "${{ steps.test-name.outputs.test-name }}" --format Size --no-header)
287+
echo "πŸ“Š Actual droplet size: $ACTUAL_SIZE"
288+
289+
if [ "$ACTUAL_SIZE" = "s-1vcpu-2gb" ]; then
290+
echo "βœ… PASS: Droplet successfully resized to 2GB"
307291
else
308-
echo "⚠️ WARNING: Could not retrieve deployment log"
292+
echo "❌ FAIL: Droplet is still $ACTUAL_SIZE (expected s-1vcpu-2gb)"
293+
echo "πŸ“‹ Droplet info:"
294+
doctl compute droplet get "${{ steps.test-name.outputs.test-name }}" --format Name,Size,Memory,Status
295+
exit 1
309296
fi
310297
311298
# Verify Mautic is still working after upgrade and resize
@@ -327,19 +314,6 @@ jobs:
327314
echo "❌ FAIL: Container is not running expected version"
328315
exit 1
329316
fi
330-
331-
# Verify droplet was actually resized
332-
echo "πŸ” Verifying droplet size via doctl..."
333-
doctl auth init --access-token "${{ secrets.DIGITALOCEAN_TOKEN }}"
334-
ACTUAL_SIZE=$(doctl compute droplet get "${{ steps.test-name.outputs.test-name }}" --format Size --no-header)
335-
echo "πŸ“Š Actual droplet size: $ACTUAL_SIZE"
336-
337-
if [ "$ACTUAL_SIZE" = "s-1vcpu-2gb" ]; then
338-
echo "βœ… PASS: Droplet is now 2GB"
339-
else
340-
echo "❌ FAIL: Droplet is still $ACTUAL_SIZE (expected s-1vcpu-2gb)"
341-
exit 1
342-
fi
343317
else
344318
echo "❌ FAIL: Mautic is not accessible after upgrade"
345319
exit 1

0 commit comments

Comments
Β (0)