You've already forked tribes-plugin-supertest
forked from tribes/tribes-plugin-template
c20a3b4f71
Rename the Supertest fixture plugin to tribe-one-supertest across manifest, runtime API routes, metrics, e2e fixtures, and tests.
62 lines
1.7 KiB
Markdown
62 lines
1.7 KiB
Markdown
# tribes-plugin-supertest
|
|
|
|
Migration and sync fixture plugin for Tribes supertest scenarios.
|
|
|
|
This plugin is intentionally small and boring. It exists so live rollout tests can
|
|
validate behavior that Aether does not cover:
|
|
|
|
- plugin-owned Ash resources
|
|
- `AshNostrSync` registration for plugin domains
|
|
- reversible plugin database migrations
|
|
- plugin-owned JSON API access from the infra runner
|
|
|
|
## Runtime surface
|
|
|
|
The plugin exposes a local-only JSON API under `/plugins-api/tribe-one-supertest`:
|
|
|
|
- `GET /health`
|
|
- `GET /schema`
|
|
- `POST /reset`
|
|
- `POST /cases`
|
|
- `POST /cases/:id/increment`
|
|
- `POST /events`
|
|
- `GET /state?run_id=...`
|
|
|
|
The API rejects non-loopback requests. Supertest calls it over SSH with curl
|
|
against `127.0.0.1:4000` on each node.
|
|
|
|
## Resources
|
|
|
|
- `TribeOne.TribesPlugin.Supertest.Case`
|
|
- `TribeOne.TribesPlugin.Supertest.Event`
|
|
|
|
Both resources are backed by `Tribes.Repo`, use `AshPostgres.DataLayer`, and
|
|
participate in `AshNostrSync`.
|
|
|
|
## Development
|
|
|
|
Use the host-backed plugin helper:
|
|
|
|
```bash
|
|
devenv shell plugin validate
|
|
devenv shell plugin test
|
|
devenv shell plugin precommit
|
|
```
|
|
|
|
Plain `mix test` and `mix precommit` are guarded because this suite expects the
|
|
host plugin test environment. Use `mix raw_test` / `mix raw_precommit` only for
|
|
low-level debugging after setting the same host environment yourself.
|
|
|
|
## Docker e2e
|
|
|
|
The Docker e2e suite builds a Tribes host release with `tribe-one-tribes-ui` and
|
|
`tribe-one-supertest`, starts two nodes, runs plugin migrations, and verifies plugin-owned
|
|
AshNostrSync resources across the cluster:
|
|
|
|
```bash
|
|
scripts/run_docker_e2e.sh
|
|
```
|
|
|
|
Set `TRIBES_HOST_ROOT=/path/to/tribes` when the host checkout is not at
|
|
`../tribes`.
|