26 lines
1.8 KiB
Markdown
26 lines
1.8 KiB
Markdown
# QA: Container update guidance
|
|
|
|
## Automated (Go, test/, httptest)
|
|
1. Fakes: in-memory update status store, fake FeedClient, fake HelperDetector, fake JobStore and restart writer, validator.InitValidator(). Mount NewSystemRouter on a fresh chi.NewRouter() with jwtauth.Verifier + Authenticator and a test jwtauth.New("HS256", ...).
|
|
2. Parse RENEWCMS_CONTAINER through config.NewSettingsFromEnv with t.Setenv over the table in the feature (true, TRUE, false, empty, yes).
|
|
3. GET status: container key present and equal to the table; the other 12 keys are unchanged.
|
|
4. Container true with a helper present: can_apply false for the owner.
|
|
5. POST check in container mode: 200, available true, stored.
|
|
6. POST download and restart in container mode: 409, no fake called.
|
|
7. Container false: the existing updates_* tests still pass.
|
|
8. An admin receives can_apply false and container true.
|
|
|
|
## SPA (Vitest, mocked /v1)
|
|
- Container + available: the block, command, Copy, "How to update", and no buttons. Reuse the "Not prepared" sample data from the board.
|
|
- Container + up to date: no Restart.
|
|
- Admin: the existing admin view.
|
|
- Non-container "Not prepared": unchanged.
|
|
- Visual: container states are PENDING until a board frame exists; report as PENDING, never as passing. Existing states must still pass `task visual:check -- settings`.
|
|
|
|
## Manual (real Docker, ./docker-compose.yml)
|
|
1. `docker compose up -d --build`; confirm RENEWCMS_CONTAINER=true with `docker compose exec renewcms env`.
|
|
2. Point UPDATE_FEED_URL at a feed with a newer release; log in as owner; /settings shows the container block, no Update or Restart.
|
|
3. The Copy button puts the exact command on the clipboard.
|
|
4. Run the shown command on a host that has a newer image; Settings shows the new version afterwards.
|
|
5. Run the binary on the host without the variable: "Not prepared" shows the old command.
|