Merge pull request 'fix: fix: smoke test leaks orphaned mock-forgejo.py processes (#196)' (#204) from fix/issue-196 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful

This commit is contained in:
dev-qwen 2026-04-05 09:20:58 +00:00
commit 6801ba3ed9
2 changed files with 4 additions and 1 deletions

View file

@ -12,6 +12,7 @@ steps:
image: python:3-alpine image: python:3-alpine
commands: commands:
- apk add --no-cache bash curl jq git coreutils - apk add --no-cache bash curl jq git coreutils
- python3 tests/mock-forgejo.py & - python3 tests/mock-forgejo.py & echo $! > /tmp/mock-forgejo.pid
- sleep 2 - sleep 2
- bash tests/smoke-init.sh - bash tests/smoke-init.sh
- kill $(cat /tmp/mock-forgejo.pid) 2>/dev/null || true

View file

@ -24,6 +24,8 @@ fail() { printf 'FAIL: %s\n' "$*" >&2; FAILED=1; }
pass() { printf 'PASS: %s\n' "$*"; } pass() { printf 'PASS: %s\n' "$*"; }
cleanup() { cleanup() {
# Kill any leftover mock-forgejo.py processes by name
pkill -f "mock-forgejo.py" 2>/dev/null || true
rm -rf "$MOCK_BIN" /tmp/smoke-test-repo \ rm -rf "$MOCK_BIN" /tmp/smoke-test-repo \
"${FACTORY_ROOT}/projects/smoke-repo.toml" "${FACTORY_ROOT}/projects/smoke-repo.toml"
# Restore .env only if we created the backup # Restore .env only if we created the backup