fix: feat: restore smoke-init CI pipeline using mock Forgejo (#124)
This commit is contained in:
parent
bd458da3f4
commit
105070e379
3 changed files with 245 additions and 91 deletions
38
.woodpecker/smoke-init.yml
Normal file
38
.woodpecker/smoke-init.yml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# .woodpecker/smoke-init.yml — Smoke test for disinto init using mock Forgejo
|
||||
#
|
||||
# Runs on PRs that touch init-related files:
|
||||
# - bin/disinto (the init code)
|
||||
# - lib/load-project.sh, lib/env.sh (init dependencies)
|
||||
# - tests/** (test changes)
|
||||
# - .woodpecker/smoke-init.yml (pipeline changes)
|
||||
#
|
||||
# Uses mock Forgejo server (starts in <1s) instead of real Forgejo.
|
||||
# Total runtime target: <10 seconds.
|
||||
#
|
||||
# Pipeline steps:
|
||||
# 1. Start mock-forgejo.py (instant startup)
|
||||
# 2. Run smoke-init.sh which:
|
||||
# - Runs disinto init against mock
|
||||
# - Verifies users, repos, labels created via API
|
||||
# - Verifies .env tokens, TOML generated, cron installed
|
||||
# - Queries /mock/state endpoint to verify all API calls made
|
||||
|
||||
when:
|
||||
- event: pull_request
|
||||
path:
|
||||
- "bin/disinto"
|
||||
- "lib/load-project.sh"
|
||||
- "lib/env.sh"
|
||||
- "tests/smoke-init.sh"
|
||||
- "tests/mock-forgejo.py"
|
||||
- ".woodpecker/smoke-init.yml"
|
||||
|
||||
steps:
|
||||
- name: smoke-init
|
||||
image: python:3-alpine
|
||||
commands:
|
||||
- apk add --no-cache bash curl jq git coreutils
|
||||
- MOCK_FORGE_PORT=3001 python3 tests/mock-forgejo.py &
|
||||
# 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue