ci: add test workflow #275
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
projects/forgejo-agent!275
Loading…
Reference in a new issue
No description provided.
Delete branch "ci/add-test-workflow"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds the missing Forgejo workflow files to run the test suite in CI, plus a small fix so
pnpm testactually exists (the README already references it).What's in it
.forgejo/workflows/test.yaml— runs on every PR tomain:srv-generic(sameci-pnpmcontainer as the other checks):pnpm test:unitsrv-homewith aservices:Forgejo instance (pinned16.0.3-rootless, same image as the devcontainer):pnpm test:integrationpackage.json— adds thetestscript (pnpm test:unit) that the README's Testing section already documents.How the integration job works
services:keyword (act_runner supports it like GitHub Actions); the job container reaches it athttp://forgejo:3000on the shared job network — the same URL the tests hardcode insrc/test/integration/shared.ts..devcontainer/docker-compose.yamlexactly:docker-setup.sh→forgejo migrate→ create thetest-botuser (the credentials fromsrc/test/integration/forgejo.env) →forgejo web.src/test/integration/setup.tsalready waits for/api/healthzand seeds the repo deterministically, so no extra provisioning step is needed.Checks
pnpm check/lint:check/format:check✅,pnpm test:unit34/34 ✅. The integration job itself can't run from this environment (no Forgejo instance here) — it needs the runner, which is exactly what this workflow provides.⚠️ One thing to verify on the runner: the
options:entrypoint override for the service (--entrypoint sh -c "..."). It's the same entrypoint the devcontainer uses, but if act_runner mangles the quoted string, the fallback is a rootdocker-compose.test.yaml+docker compose upstep on the runner. Happy to switch if it misbehaves.Waiting on https://code.forgejo.org/forgejo/runner/issues/1738 to make the forgejo entrypoint work in the action service.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.