fix: write actual mock port to file for smoke test
This commit is contained in:
parent
dfedd80d0d
commit
abe3e28a49
2 changed files with 11 additions and 7 deletions
|
|
@ -32,7 +32,10 @@ steps:
|
|||
image: python:3-alpine
|
||||
commands:
|
||||
- apk add --no-cache bash curl jq git coreutils
|
||||
- MOCK_FORGE_PORT=3001 python3 tests/mock-forgejo.py > /tmp/mock.log 2>&1 &
|
||||
# Wait for mock to be ready (might be on a different port if 3001 is in use)
|
||||
- for i in $(seq 1 30); do curl -sf http://localhost:$MOCK_FORGE_PORT/api/v1/version >/dev/null 2>&1 && break || sleep 1; done
|
||||
- SMOKE_FORGE_URL=http://localhost:$MOCK_FORGE_PORT FORGE_URL=http://localhost:$MOCK_FORGE_PORT bash tests/smoke-init.sh
|
||||
- MOCK_FORGE_PORT=3001 MOCK_FORGE_PORT_FILE=/tmp/mock-port python3 tests/mock-forgejo.py > /tmp/mock.log 2>&1 &
|
||||
- MOCK_PID=$!
|
||||
# Wait for mock to be ready
|
||||
- for i in $(seq 1 30); do [ -f /tmp/mock-port ] && break || sleep 1; done
|
||||
- MOCK_PORT=$(cat /tmp/mock-port 2>/dev/null || echo "3001")
|
||||
- for i in $(seq 1 30); do curl -sf http://localhost:$MOCK_PORT/api/v1/version >/dev/null 2>&1 && break || sleep 1; done
|
||||
- SMOKE_FORGE_URL=http://localhost:$MOCK_PORT FORGE_URL=http://localhost:$MOCK_PORT bash tests/smoke-init.sh
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue