Replay git (mirror + LFS), labels, milestones, issues & PRs (with comments), and releases (with assets) entity-by-entity over the shared Forgejo/Gitea REST API. Two-pass issue/PR creation rewrites #NNN and URL cross-references to the target number space; deleted-branch PR heads are recreated as refs/heads/_pr/<n>. CLI: codeberg-to-gitea migrate owner/name (CODEBERG_TOKEN/GITEA_TOKEN) Verified end-to-end on AlexKucera/helm: 283 issues, 1 PR, 19 labels, 219 comments, git history, with cross-refs correctly rewritten.
30 lines
747 B
Markdown
30 lines
747 B
Markdown
# tests
|
|
|
|
## Purpose
|
|
|
|
Pytest suite for `codeberg_to_gitea_migrator`.
|
|
|
|
## Ownership
|
|
|
|
Project maintainer (Alexander Kucera).
|
|
|
|
## Local Contracts
|
|
|
|
- pytest `testpaths = ["tests"]` (root `pyproject.toml`).
|
|
- Test files named `test_*.py`; test functions `test_*`.
|
|
|
|
## Work Guidance
|
|
|
|
- `test_smoke.py` — package imports + version.
|
|
- `test_refs.py` — `#NNN`/URL cross-reference rewrite + `NumberMap`.
|
|
- `test_clients.py` — `ApiClient` pagination, param cleaning, 4xx handling, JSON POST, all via `httpx.MockTransport` (no network).
|
|
- Keep tests network-free: never hit live Codeberg/Gitea from the suite. The end-to-end run is a manual CLI invocation, not a test.
|
|
|
|
## Verification
|
|
|
|
- `pytest` from the repo root.
|
|
|
|
## Child DOX Index
|
|
|
|
- No children.
|