FORGE-F008 Add unified testing toolkit for generated projects

This commit is contained in:
rob
2026-11-19 14:15:07 +00:00
parent b9cc14333a
commit 9dc4420373
20 changed files with 883 additions and 5 deletions
@@ -20,6 +20,38 @@ Windows PowerShell: create the virtual environment with `py -3 -m venv api/.venv
## Validation
The generated testing toolkit is available without Forge at runtime:
```sh
./scripts/testtask.sh --start # Compose development services and local account
./scripts/testtask.sh --status
./scripts/testtask.sh --stop # stops only this worktree's Compose project
./scripts/testrunner.sh --unit
./scripts/testrunner.sh --integration
```
The toolkit uses Git worktree metadata. Generate with `--git-init` or initialise
Git locally before using the commands; an initial commit is not required for
the current worktree. Explicit branch targets require a local branch ref and
an existing checkout.
Configure a private local test account in `~/.config/bortstack/testing.env`
with `BORTSTACK_TEST_EMAIL` and `BORTSTACK_TEST_PASSWORD`, then `chmod 600`
that file. `testtask.sh` asks before using it and permits a one-session hidden
password override. Non-interactive use requires `--use-default-credentials`.
The generated development hook creates a verified account only in this
worktree's Compose development database; an existing account is accepted only
when its password matches. Compose uses ports 5001 and 8081 by default;
adjust `.bortstack/testing.json` if they are occupied. Keep the same file's
URLs in sync. The toolkit never removes the persistent SQLite volume.
`testrunner.sh` requires the documented Python virtual environment and
`react/node_modules`; it does not install dependencies. `--act` is unavailable
until a reviewed local-safe GitHub workflow/job is explicitly allowlisted in
`.bortstack/testing.json`. The optional deployment workflow is not allowlisted.
See the generated config and Forge's toolkit README for the schema and Windows
requirements.
```sh
cd api && .venv/bin/pytest
cd react && npm run lint && npm test && npm run build