fix: improve mock Forgejo server port handling
Some checks failed
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/pr/ci Pipeline failed
ci/woodpecker/pr/smoke-init Pipeline failed

This commit is contained in:
Agent 2026-04-02 09:10:01 +00:00
parent 7190abb4e1
commit dfedd80d0d
2 changed files with 24 additions and 4 deletions

View file

@ -33,6 +33,6 @@ steps:
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
- for i in $(seq 1 30); do curl -sf http://localhost:3001/api/v1/version >/dev/null 2>&1 && break || sleep 1; done
- SMOKE_FORGE_URL=http://localhost:3001 FORGE_URL=http://localhost:3001 bash tests/smoke-init.sh
# 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