From 69875091877be6de42c1d2196ea15c64c0584c45 Mon Sep 17 00:00:00 2001 From: Linus Waldowsky Date: Fri, 27 Feb 2026 21:21:01 +0100 Subject: [PATCH] debugging --- .drone.yml | 9 +-------- scripts/run-e2e.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 8 deletions(-) create mode 100755 scripts/run-e2e.sh diff --git a/.drone.yml b/.drone.yml index dcbb766..592647c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -125,14 +125,7 @@ steps: - export VM_IP=192.168.178.$((211 + DRONE_BUILD_NUMBER % 44)) - export RUN_ID=$(echo $DRONE_COMMIT_SHA | head -c 8) - export API_URL="http://e2e$${RUN_ID}.192.168.178.201.nip.io" - - export SSHPASS="$E2E_VM_PASSWORD" - - echo "VM_IP=$VM_IP RUN_ID=$RUN_ID API_URL=$API_URL" - - echo "Waiting for VM to be reachable..." - - timeout 60 sh -c 'until sshpass -e ssh debian@'"$VM_IP"' echo ok; do sleep 5; done' - - sshpass -e scp scripts/e2e-test.sh debian@$VM_IP:/tmp/e2e-test.sh - - sshpass -e ssh debian@$VM_IP chmod +x /tmp/e2e-test.sh - - sshpass -e ssh debian@$VM_IP "REPO_URL=https://gitea.gilmour109.de/gilmour109/calchat.git COMMIT_SHA=$DRONE_COMMIT_SHA API_URL=$API_URL bash /tmp/e2e-test.sh" - - sshpass -e scp debian@$VM_IP:/tmp/e2e-results.txt /tmp/e2e-results.txt + - bash scripts/run-e2e.sh "$VM_IP" "$API_URL" "https://gitea.gilmour109.de/gilmour109/calchat.git" "$DRONE_COMMIT_SHA" "$E2E_VM_PASSWORD" - name: destroy_e2e_vm image: gitea.gilmour109.de/gilmour109/e2e-tools:latest diff --git a/scripts/run-e2e.sh b/scripts/run-e2e.sh new file mode 100755 index 0000000..6f82610 --- /dev/null +++ b/scripts/run-e2e.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Wrapper script that SSHes into the ephemeral E2E VM and runs the test script. +# Called from Drone CI to avoid ash/sh quoting issues. +# +# Usage: bash scripts/run-e2e.sh + +set -euo pipefail + +VM_IP="$1" +API_URL="$2" +REPO_URL="$3" +COMMIT_SHA="$4" +export SSHPASS="$5" + +echo "VM_IP=$VM_IP API_URL=$API_URL" +echo "Waiting for VM to be reachable..." +timeout 60 bash -c "until sshpass -e ssh debian@$VM_IP echo ok 2>/dev/null; do sleep 5; done" + +echo "VM reachable. Copying test script..." +sshpass -e scp scripts/e2e-test.sh debian@$VM_IP:/tmp/e2e-test.sh +sshpass -e ssh debian@$VM_IP chmod +x /tmp/e2e-test.sh + +echo "Running E2E tests..." +sshpass -e ssh debian@$VM_IP "REPO_URL=$REPO_URL COMMIT_SHA=$COMMIT_SHA API_URL=$API_URL bash /tmp/e2e-test.sh" + +echo "Fetching results..." +sshpass -e scp debian@$VM_IP:/tmp/e2e-results.txt /tmp/e2e-results.txt