Skip to content

Commit 73c926e

Browse files
committed
WIP
1 parent faa2bba commit 73c926e

File tree

2 files changed

+120
-11
lines changed

2 files changed

+120
-11
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: e2e-tests-arm
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
7+
jobs:
8+
docker:
9+
runs-on: macos-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Check system info
16+
run: |
17+
echo "=== System Information ==="
18+
uname -a
19+
sw_vers
20+
echo "=== Available commands ==="
21+
which brew
22+
which docker || echo "Docker not found"
23+
24+
- name: Install Docker (via Colima)
25+
run: |
26+
brew install colima docker
27+
colima start --arch aarch64 --vm-type=vz --memory 4
28+
29+
- name: Test Docker
30+
run: |
31+
docker version
32+
docker run --rm arm64v8/alpine uname -m

.github/workflows/e2e-tests-hybrid.yml

Lines changed: 88 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,42 @@ jobs:
8181
run: |
8282
# Keep the job running so regtest stays up
8383
# This will run in the background while other jobs execute
84+
echo "Starting regtest keep-alive process..."
8485
nohup bash -c 'while true; do echo "Regtest infrastructure running... $(date)"; sleep 60; done' &
86+
KEEPALIVE_PID=$!
87+
echo "Keep-alive PID: $KEEPALIVE_PID"
8588
echo "Regtest infrastructure is running in background"
89+
90+
# Verify the process is running
91+
sleep 5
92+
if ps -p $KEEPALIVE_PID > /dev/null; then
93+
echo "✅ Keep-alive process is running"
94+
else
95+
echo "❌ Keep-alive process failed to start"
96+
exit 1
97+
fi
98+
99+
# Show what's running
100+
echo "Current processes:"
101+
ps aux | grep -E "(docker|electrum|lnd|keep)" | head -10
102+
103+
# Test if services are actually accessible
104+
echo "Testing local connectivity..."
105+
if nc -z localhost 60001; then
106+
echo "✅ Electrum server is accessible locally"
107+
else
108+
echo "❌ Electrum server is NOT accessible locally"
109+
fi
110+
111+
if nc -z localhost 9735; then
112+
echo "✅ LND is accessible locally"
113+
else
114+
echo "❌ LND is NOT accessible locally"
115+
fi
116+
117+
# Show Docker containers
118+
echo "Docker containers:"
119+
docker ps
86120
87121
# Job 2: Build iOS app and run E2E tests on macOS
88122
e2e-tests:
@@ -309,16 +343,9 @@ jobs:
309343
echo "Ensuring simulator is ready..."
310344
xcrun simctl list devices | grep "$SIMULATOR_UDID"
311345
312-
# Verify app is installed and get the correct bundle ID
346+
# Verify app is installed
313347
echo "Verifying app installation..."
314-
APP_BUNDLE_ID=$(xcrun simctl listapps "$SIMULATOR_UDID" | grep -i bitkit | grep -o '"[^"]*"' | head -1 | tr -d '"')
315-
echo "App bundle ID: $APP_BUNDLE_ID"
316-
317-
# Update the app bundle ID in wdio.conf.ts if needed
318-
if [ -n "$APP_BUNDLE_ID" ] && [ "$APP_BUNDLE_ID" != "to.bitkit-regtest" ]; then
319-
echo "Updating app bundle ID in capabilities..."
320-
sed -i '' "s/'appium:app': path.join(__dirname, 'aut', 'bitkit.app')/'appium:app': path.join(__dirname, 'aut', 'bitkit.app'),\n 'appium:bundleId': '$APP_BUNDLE_ID'/" wdio.conf.ts
321-
fi
348+
xcrun simctl listapps "$SIMULATOR_UDID" | grep -i bitkit || echo "App not found"
322349
323350
# Make sure simulator is fully booted and ready
324351
echo "Waiting for simulator to be fully ready..."
@@ -357,15 +384,40 @@ jobs:
357384
echo "E2E_ELECTRUM_SERVER: $E2E_ELECTRUM_SERVER"
358385
echo "E2E_LND_URL: $E2E_LND_URL"
359386
387+
# Check if we have valid regtest URLs
388+
if [ -z "$E2E_ELECTRUM_SERVER" ] || [ -z "$E2E_LND_URL" ]; then
389+
echo "❌ ERROR: Regtest URLs are empty!"
390+
echo "This means the regtest-infrastructure job failed or didn't provide outputs."
391+
echo "Check the regtest-infrastructure job logs for errors."
392+
exit 1
393+
fi
394+
360395
# Test electrum server connectivity
361396
if [ -n "$E2E_ELECTRUM_SERVER" ]; then
362397
ELECTRUM_HOST=$(echo "$E2E_ELECTRUM_SERVER" | cut -d: -f1)
363398
ELECTRUM_PORT=$(echo "$E2E_ELECTRUM_SERVER" | cut -d: -f2)
364399
echo "Testing electrum server at $ELECTRUM_HOST:$ELECTRUM_PORT..."
400+
401+
# Try multiple connection methods
402+
echo "Testing with nc (netcat)..."
365403
if nc -z "$ELECTRUM_HOST" "$ELECTRUM_PORT" 2>/dev/null; then
366-
echo "✅ Electrum server is reachable"
404+
echo "✅ Electrum server is reachable via nc"
405+
else
406+
echo "❌ Electrum server is not reachable via nc"
407+
fi
408+
409+
echo "Testing with telnet..."
410+
if timeout 5 telnet "$ELECTRUM_HOST" "$ELECTRUM_PORT" 2>/dev/null | grep -q "Connected"; then
411+
echo "✅ Electrum server is reachable via telnet"
367412
else
368-
echo "❌ Electrum server is not reachable"
413+
echo "❌ Electrum server is not reachable via telnet"
414+
fi
415+
416+
echo "Testing with curl..."
417+
if curl -s --connect-timeout 5 "http://$ELECTRUM_HOST:$ELECTRUM_PORT" >/dev/null 2>&1; then
418+
echo "✅ Electrum server is reachable via curl"
419+
else
420+
echo "❌ Electrum server is not reachable via curl"
369421
fi
370422
fi
371423
@@ -378,6 +430,31 @@ jobs:
378430
echo "✅ LND is reachable"
379431
else
380432
echo "❌ LND is not reachable"
433+
echo "This will cause tests to fail. Check if the regtest infrastructure job is still running."
434+
fi
435+
fi
436+
437+
# Check if we should continue with tests despite connectivity issues
438+
if [ -n "$E2E_ELECTRUM_SERVER" ] && [ -n "$E2E_LND_URL" ]; then
439+
ELECTRUM_HOST=$(echo "$E2E_ELECTRUM_SERVER" | cut -d: -f1)
440+
ELECTRUM_PORT=$(echo "$E2E_ELECTRUM_SERVER" | cut -d: -f2)
441+
LND_HOST=$(echo "$E2E_LND_URL" | cut -d: -f1)
442+
LND_PORT=$(echo "$E2E_LND_URL" | cut -d: -f2)
443+
444+
if ! nc -z "$ELECTRUM_HOST" "$ELECTRUM_PORT" 2>/dev/null || ! nc -z "$LND_HOST" "$LND_PORT" 2>/dev/null; then
445+
echo "⚠️ WARNING: Regtest services are not reachable. Tests will likely fail."
446+
echo "This could be due to:"
447+
echo "1. The regtest infrastructure job has stopped"
448+
echo "2. Network connectivity issues between runners"
449+
echo "3. Firewall blocking the connections"
450+
echo ""
451+
echo "🔧 SOLUTIONS TO TRY:"
452+
echo "1. Check if the regtest-infrastructure job is still running"
453+
echo "2. Use a different regtest service (e.g., Blockstream's regtest API)"
454+
echo "3. Run regtest on the same macOS runner (if Docker works)"
455+
echo "4. Use a cloud-hosted regtest service"
456+
echo ""
457+
echo "Continuing with tests anyway..."
381458
fi
382459
fi
383460

0 commit comments

Comments
 (0)