2026-04-02 07:48:59 +00:00
|
|
|
# .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
|
2026-04-02 07:51:29 +00:00
|
|
|
path:
|
2026-04-02 07:48:59 +00:00
|
|
|
- "bin/disinto"
|
|
|
|
|
- "lib/load-project.sh"
|
|
|
|
|
- "lib/env.sh"
|
2026-04-02 07:51:29 +00:00
|
|
|
- "tests/smoke-init.sh"
|
|
|
|
|
- "tests/mock-forgejo.py"
|
2026-04-02 07:48:59 +00:00
|
|
|
- ".woodpecker/smoke-init.yml"
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- name: smoke-init
|
|
|
|
|
image: python:3-alpine
|
|
|
|
|
commands:
|
2026-04-02 07:58:39 +00:00
|
|
|
- apk add --no-cache bash curl jq git
|
|
|
|
|
- MOCK_FORGE_PORT=3001 python3 tests/mock-forgejo.py &
|
2026-04-02 07:55:23 +00:00
|
|
|
# Wait for mock to be ready
|
2026-04-02 07:58:39 +00:00
|
|
|
- for i in $(seq 1 30); do curl -sf http://localhost:3001/api/v1/version >/dev/null 2>&1 && break || sleep 1; done
|
2026-04-02 07:59:16 +00:00
|
|
|
- SMOKE_FORGE_URL=http://localhost:3001 FORGE_URL=http://localhost:3001 bash tests/smoke-init.sh
|