mirror of
https://github.com/azaion/ui.git
synced 2026-06-22 04:01:11 +00:00
[AZ-474] [AZ-480] Batch 8 - tile-split + nginx/image static checks (Phase A close)
- AZ-474 tile-split + YOLO parser + auto-zoom + indicator + malformed (FT-P-51..55, FT-N-10): 13 fast (6 it.fails for AC-1..6 + 7 controls) + 2 e2e (test.fail for FT-P-51 + FT-P-53). The split surface is QUARANTINED today (D11) — no Split-tile button, no parser, no <TileViewer>; all 6 ACs are documented drift, every it.fails paired with a control PASS pinning current behaviour. - AZ-480 prod image + nginx routing + RAM (NFT-RES-LIM-02 /03/08/09/10): 4 new static checks promoted into the per-commit profile (STC-RES02 500M cap, STC-RES03 Dockerfile final-stage nginx:alpine no Node, STC-RES09 exactly 9 /api/* location blocks, STC-RES10 prefix-strip on every route). 3 e2e (docker-no-Node probe, runtime prefix-strip, long-running RAM soak — all gated on docker availability + image build; RAM soak also on RUN_LONG_RUNNING=1). Phase A — One-time baseline setup is now COMPLETE. The todo/ directory is empty after this batch's archival. Cumulative review for batches 07-08 is the next autodev action; after that, Step 7 (Run Tests) auto-chains. Code review: PASS (0 findings). Fast: 26/26 files, 163 passed / 13 skipped. Static: 29/29 PASS (incl. 4 new STC-RES* gates). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
# Test — Tile Split, Zoom Indicator & YOLO Parser
|
||||
|
||||
**Task**: AZ-474_test_tile_split_zoom
|
||||
**Name**: Tile-split endpoint + YOLO parser + isSplit handling + auto-zoom viewport + zoom indicator + malformed parse
|
||||
**Description**: Implement the 6 blackbox tests covering the tile-split feature: endpoint contract, YOLO label parser happy path, `DatasetItem.isSplit` honor, auto-zoom viewport matching tile rect, indicator visibility, and the malformed-label error path.
|
||||
**Complexity**: 3 points
|
||||
**Dependencies**: AZ-456_test_infrastructure
|
||||
**Component**: 07_dataset (tile split / zoom) + 06_annotations (parser) (Blackbox Tests)
|
||||
**Tracker**: AZ-474
|
||||
**Epic**: AZ-455
|
||||
|
||||
## Problem
|
||||
|
||||
Tile-split + tile-zoom is the most-numerically-intensive feature in the SPA. A single off-by-one in the YOLO label parser or a stale viewport calc loses every annotation in the tile. The malformed-label path must surface a user-visible error (per AC-39 sad path), not silently produce NaN-rendered boxes.
|
||||
|
||||
## Outcome
|
||||
|
||||
- 6 scenarios pass.
|
||||
|
||||
## Scope
|
||||
|
||||
### Included
|
||||
|
||||
| Scenario | Profile | Source file |
|
||||
|----------|---------|-------------|
|
||||
| FT-P-51 — tile-split endpoint contract | fast + e2e | blackbox-tests.md |
|
||||
| FT-P-52 — YOLO label parser — happy path | fast | blackbox-tests.md |
|
||||
| FT-P-53 — `DatasetItem.isSplit` is honored on the dataset list path | fast + e2e | blackbox-tests.md |
|
||||
| FT-P-54 — tile auto-zoom viewport matches tile rect | fast | blackbox-tests.md |
|
||||
| FT-P-55 — tile-zoom indicator visible while active | fast | blackbox-tests.md |
|
||||
| FT-N-10 — malformed YOLO label surfaces a user-visible error (no silent swallow, no NaN render) | fast | blackbox-tests.md |
|
||||
|
||||
### Excluded
|
||||
|
||||
- Canvas-pixel coordinate math (covered in 16_test_canvas_bbox).
|
||||
- Annotation save body shape (covered in 05_test_annotations_endpoint).
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
**AC-1: Endpoint contract**
|
||||
FT-P-51 — outbound URL + body for tile-split match the contract.
|
||||
|
||||
**AC-2: YOLO parser happy**
|
||||
FT-P-52 — input `"3 0.5 0.5 0.2 0.2"` produces the canonical 5-tuple { classId: 3, cx: 0.5, cy: 0.5, w: 0.2, h: 0.2 }.
|
||||
|
||||
**AC-3: isSplit honored**
|
||||
FT-P-53 — dataset items with `isSplit: true` render the split affordance; items with `false` do not.
|
||||
|
||||
**AC-4: Auto-zoom**
|
||||
FT-P-54 — entering a tile sets the viewport to the tile rect (±0.5 px tolerance).
|
||||
|
||||
**AC-5: Indicator visibility**
|
||||
FT-P-55 — while zoomed into a tile, the indicator is visible with the correct ARIA label.
|
||||
|
||||
**AC-6: Malformed parser**
|
||||
FT-N-10 — input `"garbage"` produces a user-visible error (toast or inline) and NO bbox render. Asserted via DOM (error region present) AND `getBoundingClientRect` returning finite values for every rendered box (no NaN).
|
||||
|
||||
## System Under Test Boundary
|
||||
|
||||
- System under test: `<DatasetPage>` + `<TileViewer>` + the YOLO parser module.
|
||||
- Allowed stubs: MSW for tile-split endpoint + dataset list.
|
||||
- Disallowed: stubbing the parser or reading its state — tests pass input via the public surface (typically a paste / load) and assert the rendered result.
|
||||
- Expected observables per `results_report.md` rows 85-90 (Group 17) + the row for FT-N-10.
|
||||
|
||||
## Constraints
|
||||
|
||||
- The malformed-label test (FT-N-10) MUST NOT pass by virtue of `alert()` — that's banned by NFT-SEC-07. The error must be in-DOM.
|
||||
|
||||
## Risks & Mitigation
|
||||
|
||||
**Risk 1 — Viewport rect comparison flakiness**
|
||||
- *Risk*: `getBoundingClientRect` values depend on layout timing.
|
||||
- *Mitigation*: wait for `requestAnimationFrame` before measuring; ±0.5 px tolerance.
|
||||
@@ -0,0 +1,62 @@
|
||||
# Test — Production Image, nginx Routes & Edge-host RAM
|
||||
|
||||
**Task**: AZ-480_test_prod_image_nginx_ram
|
||||
**Name**: nginx:alpine no-Node + 500M cap + 9 routes + prefix-strip + edge-host RAM
|
||||
**Description**: Implement the 5 blackbox tests pinning the production container surface: nginx:alpine image with no Node runtime (NFT-RES-LIM-03), `client_max_body_size 500M` (NFT-RES-LIM-02), exactly 9 location blocks for the suite services (NFT-RES-LIM-09), each route strips its `/api/<service>/` prefix (NFT-RES-LIM-10), and steady-state RAM on the edge image (NFT-RES-LIM-08).
|
||||
**Complexity**: 3 points
|
||||
**Dependencies**: AZ-456_test_infrastructure
|
||||
**Component**: 00_foundation (build + image) (Blackbox Tests)
|
||||
**Tracker**: AZ-480
|
||||
**Epic**: AZ-455
|
||||
|
||||
## Problem
|
||||
|
||||
The production image MUST be `nginx:alpine` (no Node — defence against "I'll just add a tiny Node helper" regressions), enforce a 500 MB body cap (matches NFT-PERF / upload cap), expose exactly 9 nginx routes (one per suite service), strip the route prefix (so upstream services see the canonical path), and keep RAM bounded at steady state. These are five contract pins on the runtime surface that have no source-code home — they live in the image / nginx config and CI build.
|
||||
|
||||
## Outcome
|
||||
|
||||
- 5 scenarios pass.
|
||||
|
||||
## Scope
|
||||
|
||||
### Included
|
||||
|
||||
| Scenario | Profile | Source file |
|
||||
|----------|---------|-------------|
|
||||
| NFT-RES-LIM-02 — nginx `client_max_body_size 500M` | static | resource-limit-tests.md |
|
||||
| NFT-RES-LIM-03 — Production image is `nginx:alpine` and carries no Node.js | static + e2e | resource-limit-tests.md |
|
||||
| NFT-RES-LIM-08 — Edge-host RAM profile of the UI image at steady state | e2e | resource-limit-tests.md |
|
||||
| NFT-RES-LIM-09 — nginx routes — exactly 9 location blocks for the suite services | static | resource-limit-tests.md |
|
||||
| NFT-RES-LIM-10 — nginx — each route strips its `/api/<service>/` prefix | static + e2e | resource-limit-tests.md |
|
||||
|
||||
### Excluded
|
||||
|
||||
- CI image-tag scheme + OCI labels (covered in 26_test_ci_image_labels).
|
||||
- Bundle exclusions (covered in 24_test_bundle_fcp_soak).
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
**AC-1: nginx config — 500 MB cap**
|
||||
NFT-RES-LIM-02 — `grep -E 'client_max_body_size\s+500M'` against `nginx/conf.d/*.conf` returns exactly one hit (in the SPA server block).
|
||||
|
||||
**AC-2: nginx:alpine, no Node**
|
||||
NFT-RES-LIM-03 — `Dockerfile` base image is `nginx:alpine` (or a versioned variant thereof); the produced image, run with `docker run --rm $IMAGE which node`, returns non-zero. E2e probes the running container.
|
||||
|
||||
**AC-3: Steady-state RAM**
|
||||
NFT-RES-LIM-08 — boot the production image with the suite test stack; after 5 min of idle traffic, `docker stats $CONTAINER --no-stream --format '{{.MemUsage}}'` reports usage ≤ the published edge budget (per `_docs/02_document/tests/environment.md`).
|
||||
|
||||
**AC-4: 9 routes**
|
||||
NFT-RES-LIM-09 — `grep -cE '^\s*location\s+/api/'` against `nginx/conf.d/*.conf` returns exactly 9.
|
||||
|
||||
**AC-5: Prefix strip**
|
||||
NFT-RES-LIM-10 — for each suite service `S`, a request to `/api/<S>/probe` reaches `S` with the path `/probe` (asserted via the suite's echo endpoints). Static check additionally verifies `rewrite ^/api/<S>/(.*)$ /$1 break;` or equivalent for each route.
|
||||
|
||||
## System Under Test Boundary
|
||||
|
||||
- System under test: `Dockerfile`, `nginx/conf.d/*.conf` (or equivalent), and the built image.
|
||||
- Allowed stubs: suite echo endpoints for the prefix-strip e2e assertion.
|
||||
- Disallowed: stubbing nginx itself.
|
||||
|
||||
## Constraints
|
||||
|
||||
- E2E tests (AC-2, AC-3, AC-5) run against the suite docker-compose stack; tagged `@requires-docker`.
|
||||
Reference in New Issue
Block a user