37 lines
1.1 KiB
YAML
37 lines
1.1 KiB
YAML
|
|
# .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/**"
|
||
|
|
- ".woodpecker/smoke-init.yml"
|
||
|
|
|
||
|
|
steps:
|
||
|
|
- name: smoke-init
|
||
|
|
image: python:3-alpine
|
||
|
|
commands:
|
||
|
|
- apk add --no-cache bash curl jq git coreutils
|
||
|
|
- python3 tests/mock-forgejo.py &
|
||
|
|
- sleep 1 # wait for mock to start
|
||
|
|
- bash tests/smoke-init.sh
|