Skip to content

Commit 129a138

Browse files
Copilotsofthack007
andcommitted
Change port forwarding from 80 to 8080 (non-privileged port)
Port 80 is a privileged port requiring root permissions, which CI jobs don't have and shouldn't require. Changed to use port 8080 instead: - Updated workflow to use port 8080 for QEMU - Changed default port in run-qemu.sh from 80 to 8080 - Updated all test URLs to use localhost:8080 - Updated README documentation with correct port - Updated Playwright config default baseURL to use port 8080 This allows QEMU to start without requiring root/sudo privileges. Co-authored-by: softhack007 <[email protected]>
1 parent 19df216 commit 129a138

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

.github/scripts/run-qemu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -e
66

77
FIRMWARE_DIR="${1:-.pio/build/esp32dev}"
88
QEMU_DIR="${2:-qemu-esp32}"
9-
HTTP_PORT="${3:-80}"
9+
HTTP_PORT="${3:-8080}" # Default to 8080 (non-privileged port)
1010

1111
if [ ! -d "$FIRMWARE_DIR" ]; then
1212
echo "Error: Firmware directory not found: $FIRMWARE_DIR"

.github/workflows/qemu-e2e-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
- name: Start QEMU with WLED firmware in background
101101
run: |
102102
chmod +x .github/scripts/run-qemu.sh
103-
bash .github/scripts/run-qemu.sh .pio/build/esp32dev qemu-esp32 80 > qemu-output.log 2>&1 &
103+
bash .github/scripts/run-qemu.sh .pio/build/esp32dev qemu-esp32 8080 > qemu-output.log 2>&1 &
104104
echo "Waiting for QEMU to start and WLED to boot..."
105105
sleep 45
106106
@@ -124,7 +124,7 @@ jobs:
124124
125125
# Wait up to 2 minutes for HTTP server to respond
126126
for i in {1..60}; do
127-
if curl -f -m 5 http://localhost/ > /dev/null 2>&1; then
127+
if curl -f -m 5 http://localhost:8080/ > /dev/null 2>&1; then
128128
echo "SUCCESS: WLED HTTP server is responding!"
129129
exit 0
130130
fi
@@ -138,7 +138,7 @@ jobs:
138138
139139
- name: Run Playwright tests against QEMU
140140
env:
141-
WLED_BASE_URL: http://localhost
141+
WLED_BASE_URL: http://localhost:8080
142142
run: npm run test:e2e
143143

144144
- name: Upload QEMU logs

e2e-tests/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ Test the actual firmware running in QEMU ESP32 emulator:
4444

4545
3. **Run firmware in QEMU** (in a separate terminal):
4646
```bash
47-
bash .github/scripts/run-qemu.sh .pio/build/esp32dev qemu-esp32 80
47+
bash .github/scripts/run-qemu.sh .pio/build/esp32dev qemu-esp32 8080
4848
```
4949

5050
Wait ~30-45 seconds for ESP32 to boot and start the web server.
5151

5252
4. **Run tests**:
5353
```bash
54-
WLED_BASE_URL=http://localhost npm run test:e2e
54+
WLED_BASE_URL=http://localhost:8080 npm run test:e2e
5555
```
5656

5757
### Test with Real Hardware
@@ -69,13 +69,13 @@ To test against a real ESP32 device:
6969

7070
```bash
7171
# Run tests in UI mode (interactive)
72-
WLED_BASE_URL=http://localhost npm run test:e2e:ui
72+
WLED_BASE_URL=http://localhost:8080 npm run test:e2e:ui
7373

7474
# Run tests in debug mode
75-
WLED_BASE_URL=http://localhost npm run test:e2e:debug
75+
WLED_BASE_URL=http://localhost:8080 npm run test:e2e:debug
7676

7777
# Run a specific test file
78-
WLED_BASE_URL=http://localhost npx playwright test e2e-tests/index.spec.js
78+
WLED_BASE_URL=http://localhost:8080 npx playwright test e2e-tests/index.spec.js
7979
```
8080

8181
## Test Structure

playwright.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = defineConfig({
2020
reporter: 'html',
2121
timeout: 45000, // 45 seconds per test (QEMU can be slow)
2222
use: {
23-
baseURL: process.env.WLED_BASE_URL || 'http://localhost',
23+
baseURL: process.env.WLED_BASE_URL || 'http://localhost:8080',
2424
trace: 'on-first-retry',
2525
screenshot: 'only-on-failure',
2626
navigationTimeout: 20000, // 20 seconds for navigation (QEMU startup)

0 commit comments

Comments
 (0)