1.8 KiB
1.8 KiB
QA: Container update guidance
Automated (Go, test/, httptest)
- 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", ...).
- Parse RENEWCMS_CONTAINER through config.NewSettingsFromEnv with t.Setenv over the table in the feature (true, TRUE, false, empty, yes).
- GET status: container key present and equal to the table; the other 12 keys are unchanged.
- Container true with a helper present: can_apply false for the owner.
- POST check in container mode: 200, available true, stored.
- POST download and restart in container mode: 409, no fake called.
- Container false: the existing updates_* tests still pass.
- 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)
docker compose up -d --build; confirm RENEWCMS_CONTAINER=true withdocker compose exec renewcms env.- Point UPDATE_FEED_URL at a feed with a newer release; log in as owner; /settings shows the container block, no Update or Restart.
- The Copy button puts the exact command on the clipboard.
- Run the shown command on a host that has a newer image; Settings shows the new version afterwards.
- Run the binary on the host without the variable: "Not prepared" shows the old command.