fix: feat: end-to-end disinto init smoke test in CI (#668)

Add tests/smoke-init.sh — an end-to-end smoke test that runs
disinto init --bare --yes against a real Forgejo instance
(started as a Woodpecker service container).

The test validates:
- Forgejo API responds after init
- Admin and bot users created with tokens
- Repo created with labels on Forgejo
- Project TOML generated correctly
- .env written with FORGE_TOKEN and FORGE_REVIEW_TOKEN
- Cron entries installed (dev-poll, review-poll, gardener)

Uses mock binaries for docker (routes user creation to Forgejo
admin API), claude, tmux, and crontab to run in CI without
Docker-in-Docker.

Wired into CI via .woodpecker/smoke-init.yml (separate pipeline
with Forgejo service, runs on push and pull_request).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
openhands 2026-03-25 09:37:36 +00:00
parent b2dd42df40
commit 9c2a5634ff
2 changed files with 454 additions and 0 deletions

View file

@ -0,0 +1,24 @@
# .woodpecker/smoke-init.yml — End-to-end smoke test for disinto init
#
# Starts a real Forgejo instance as a service container, then runs
# disinto init --bare --yes against it and verifies the results.
when:
event: [push, pull_request]
services:
- name: forgejo
image: codeberg.org/forgejo/forgejo:11.0
environment:
FORGEJO__database__DB_TYPE: sqlite3
FORGEJO__server__ROOT_URL: "http://forgejo:3000/"
FORGEJO__server__HTTP_PORT: "3000"
steps:
- name: smoke-init
image: debian:bookworm-slim
environment:
SMOKE_FORGE_URL: http://forgejo:3000
commands:
- apt-get update -qq && apt-get install -y -qq --no-install-recommends bash curl jq python3 git ca-certificates >/dev/null 2>&1
- bash tests/smoke-init.sh