mirror of
https://github.com/azaion/missions.git
synced 2026-06-21 09:41:08 +00:00
[AZ-577] [AZ-578] [AZ-579] [AZ-580] Implement E2E test batch 2
Adds 26 blackbox tests (FT-P-01..18, FT-N-01..08) covering full AC
matrices for Vehicles/Missions/Waypoints/Health/Errors. Three
spec-vs-code carry-forwards documented in batch_02_report.md and
pinned with [Trait("carry_forward", ...)].
Shared scaffolding: ApiDtos.cs, AssertProblemEnvelopeAsync helper,
Seeds.cs, StubSchema.cs, CascadeF3/F4 fixtures, PostgresStopStart
fixture (gated by COMPOSE_RESTART_ENABLED). Removes the 4 placeholder
Sanity.cs files (now superseded). docker-compose.test.yml gains the
expected_results volume mount + FIXTURE_SQL_DIR for the consumer.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
# Batch Report
|
||||
|
||||
**Batch**: 2
|
||||
**Tasks**: AZ-577, AZ-578, AZ-579, AZ-580
|
||||
**Date**: 2026-05-15
|
||||
**Run mode**: Test implementation (existing-code Step 6)
|
||||
**Total complexity**: 18 SP (5 + 5 + 5 + 3)
|
||||
|
||||
## Task Results
|
||||
|
||||
| Task | Status | Files Modified | Tests | AC Coverage | Issues |
|
||||
|------|--------|----------------|-------|-------------|--------|
|
||||
| AZ-577_test_vehicles_positive | Done | 3 added (1 deleted) | 6 / 6 pass discovery, AAA pass | 6/6 ACs covered | 1 carry-forward |
|
||||
| AZ-578_test_missions_positive | Done | 3 added (1 deleted) | 6 / 6 pass discovery, AAA pass | 6/6 ACs covered | 0 |
|
||||
| AZ-579_test_waypoints_health_positive | Done | 4 added (2 deleted) | 6 / 6 pass discovery, AAA pass | 6/6 ACs covered | 2 carry-forwards |
|
||||
| AZ-580_test_validation_authz_negative | Done | 5 added | 8 / 8 pass discovery, AAA pass | 8/8 ACs covered | 1 carry-forward |
|
||||
|
||||
## AC Test Coverage: All 26 covered
|
||||
|
||||
- **AZ-577 (6/6)**: AC-1 → FT_P_01, AC-2 → FT_P_02, AC-3 → FT_P_03 (carry-forward), AC-4 → FT_P_04, AC-5 → FT_P_05, AC-6 → FT_P_06.
|
||||
- **AZ-578 (6/6)**: AC-1 → FT_P_07, AC-2 → FT_P_08, AC-3 → FT_P_09, AC-4 → FT_P_10, AC-5 → FT_P_11, AC-6 → FT_P_12 (own collection `CascadeF3`).
|
||||
- **AZ-579 (6/6)**: AC-1 → FT_P_13, AC-2 → FT_P_14 (carry-forward flat geo), AC-3 → FT_P_15 (carry-forward flat geo), AC-4 → FT_P_16, AC-5 → FT_P_17 (SkippableFact gated on `COMPOSE_RESTART_ENABLED`), AC-6 → FT_P_18 (own collection `CascadeF4`).
|
||||
- **AZ-580 (8/8)**: AC-1 → FT_N_01, AC-2 → FT_N_02, AC-3 → FT_N_03, AC-4 → FT_N_04 (carry-forward), AC-5 → FT_N_05, AC-6 → FT_N_06 (own collection, pg_stat_statements + row-count belt-and-braces), AC-7 → FT_N_07 (carry-forward), AC-8 → FT_N_08 (own collection `ErrorEnvelope500`, SkippableFact).
|
||||
|
||||
## Code Review Verdict: PASS_WITH_WARNINGS (self-review)
|
||||
|
||||
Formal `/code-review` skill was not invoked for this batch (covered by the cumulative-review interval). Self-review:
|
||||
|
||||
- 0 Critical, 0 High, 0 Medium.
|
||||
- **Low — design**: 3 spec-vs-code carry-forwards explicitly documented as source-level `// CARRY-FORWARD` comments + `[Trait("carry_forward", ...)]` so the next divergence-resolution task can find them via filter.
|
||||
- **Low — coverage**: 2 SkippableFact tests (FT-P-17 and FT-N-08) require `COMPOSE_RESTART_ENABLED=1` plus `docker` CLI access in the e2e-consumer image. Today the consumer image is `mcr.microsoft.com/dotnet/sdk:10.0` without `docker-cli` installed and without a docker socket bind in `docker-compose.test.yml`. The skip reason is explicit (no silent pass).
|
||||
- **Low — coverage**: FT-N-06's strict "no DELETE statements emitted" check uses `pg_stat_statements`. The extension is not in the postgres-test image's `shared_preload_libraries` today, so `CREATE EXTENSION` will return SQLState 0A000. The test then falls back to a per-table row-count invariant check (which still catches the bug if cascade actually ran). When/if the postgres-test image gains the preload, the strict check activates automatically.
|
||||
|
||||
## Auto-Fix Attempts: 1
|
||||
|
||||
Initial build produced 89× xUnit1030 warnings ("Test methods should not call `ConfigureAwait(false)`"). Auto-fixed by removing all `.ConfigureAwait(false)` calls from test method bodies (Style/Low — eligible per Auto-Fix Gate matrix). Re-build: 0 warnings, 0 errors. Reporting + AaaPatternEnforcement tests still pass (5/5).
|
||||
|
||||
## Stuck Agents: None
|
||||
|
||||
## Spec-vs-Code Divergences (3 carry-forwards)
|
||||
|
||||
User chose "write tests TO CODE" for batch 2 (`/autodev` interactive choice, 2026-05-15). Each divergence is pinned with a `[Trait("carry_forward", ...)]` so a future cleanup task can `dotnet test --filter "carry_forward~..."` to locate every flip-when-resolved site.
|
||||
|
||||
| Site | Spec says | Code says | Test assertion |
|
||||
|------|-----------|-----------|----------------|
|
||||
| FT-P-03 setDefault — `Vehicles/PositiveTests.cs` | `POST /vehicles/{id}/setDefault` → `200` with `Vehicle` body | `[HttpPatch("{id:guid}/default")]` → `204 NoContent` | `PATCH … /default` + `204` + DB-side-channel default invariant |
|
||||
| FT-P-14 / FT-P-15 — `Waypoints/PositiveTests.cs` | response body has nested `GeoPoint:{Lat,Lon,Mgrs}` | response is the LinqToDB `Waypoint` entity with flat `Lat`/`Lon`/`Mgrs` columns | flat-shape assertions (`waypoint.Lat`, `waypoint.Mgrs`) |
|
||||
| FT-N-07 — `Waypoints/NegativeTests.cs` | missing parent mission → `404` with problem envelope | `WaypointService.GetWaypoints` does not check parent — returns `[]` | `200` + body `[]`, marked `[Trait("carry_forward", "AC-4.2")]` |
|
||||
|
||||
These flip the moment the spec/code is reconciled (either the controller adds the route + return shape, or the spec is updated). The tests will fail loudly at that point — that is intentional.
|
||||
|
||||
## Files Created (15)
|
||||
|
||||
### Helpers / Fixtures (shared scaffolding, 6 files)
|
||||
|
||||
- `tests/Azaion.Missions.E2E.Tests/Helpers/ApiDtos.cs` — wire DTOs (Vehicle, Mission, Waypoint, PaginatedResponse, Problem) with explicit `[JsonPropertyName]` so a future global camelCase migration breaks tests loudly
|
||||
- `tests/Azaion.Missions.E2E.Tests/Helpers/HttpAssertions.cs` — added `AssertProblemEnvelopeAsync(response, status)` (existing file extended; no behavior change to `AssertErrorEnvelopeAsync`)
|
||||
- `tests/Azaion.Missions.E2E.Tests/Fixtures/Seeds.cs` — `OneDefaultVehicle`, `Three_BR01_BR02_MQ9`, `TwentyFiveMissions`, `FiveWaypointsUnordered`
|
||||
- `tests/Azaion.Missions.E2E.Tests/Fixtures/StubSchema.cs` — borrowed-table CREATE IF NOT EXISTS for `media`, `annotations`, `detection`
|
||||
- `tests/Azaion.Missions.E2E.Tests/Fixtures/CascadeF3Fixture.cs` — loads `fixture_cascade_F3.sql`
|
||||
- `tests/Azaion.Missions.E2E.Tests/Fixtures/CascadeF4Fixture.cs` — loads `fixture_cascade_F4.sql`
|
||||
- `tests/Azaion.Missions.E2E.Tests/Fixtures/PostgresStopStartFixture.cs` — wraps `docker compose stop|start postgres-test` for FT-P-17, gated on `COMPOSE_RESTART_ENABLED=1`
|
||||
|
||||
### Test classes (10 files; the deleted `Sanity.cs` files are listed under "Files Deleted" below)
|
||||
|
||||
- `Tests/Vehicles/PositiveTests.cs` — FT-P-01..06
|
||||
- `Tests/Vehicles/NegativeTests.cs` — FT-N-01, FT-N-02, FT-N-03
|
||||
- `Tests/Missions/PositiveTests.cs` — FT-P-07..11
|
||||
- `Tests/Missions/CascadeF3Tests.cs` — FT-P-12 (own xUnit collection)
|
||||
- `Tests/Missions/NegativeTests.cs` — FT-N-04, FT-N-05
|
||||
- `Tests/Missions/CascadeShortCircuitTests.cs` — FT-N-06 (own collection)
|
||||
- `Tests/Waypoints/PositiveTests.cs` — FT-P-13, FT-P-14, FT-P-15
|
||||
- `Tests/Waypoints/CascadeF4Tests.cs` — FT-P-18 (own collection)
|
||||
- `Tests/Waypoints/NegativeTests.cs` — FT-N-07
|
||||
- `Tests/Health/HealthTests.cs` — FT-P-16, FT-P-17 (FT-P-17 is `[SkippableFact]`)
|
||||
- `Tests/Errors/Error500Tests.cs` — FT-N-08 (own collection `ErrorEnvelope500`, `[SkippableFact]`)
|
||||
|
||||
### Files Deleted (4 placeholder Sanity.cs)
|
||||
|
||||
Each Sanity test was a discovery-only `[Fact]` placed by AZ-576 to satisfy the "every test folder has ≥ 1 test" requirement. Now-replaced by full FT-P-* / FT-N-* coverage in the same folder, so deletion is dead-code hygiene.
|
||||
|
||||
- `Tests/Vehicles/Sanity.cs`, `Tests/Missions/Sanity.cs`, `Tests/Waypoints/Sanity.cs`, `Tests/Health/Sanity.cs`
|
||||
|
||||
### Compose updates
|
||||
|
||||
- `docker-compose.test.yml` — added `FIXTURE_SQL_DIR=/app/fixtures` env var and read-only volume mount `./_docs/00_problem/input_data/expected_results:/app/fixtures:ro` for the e2e-consumer service. Required because `Helpers/FixtureSql.cs` looks up SQL files at the canonical path; the AZ-576 compose file did not yet wire it.
|
||||
|
||||
## Local Verification
|
||||
|
||||
`dotnet build … -c Release` — 0 warnings, 0 errors after auto-fix.
|
||||
|
||||
`dotnet test … --filter "FullyQualifiedName~AaaPatternEnforcement|FullyQualifiedName~Reporting"` — 5 / 5 pass (the docker-free subset). The blackbox tests added in this batch require the docker compose stack and are validated by the autodev Step 7 (`test-run/SKILL.md`) gate.
|
||||
|
||||
`dotnet test … --list-tests | grep "FT_[PN]_"` — 26 tests discovered (18 FT-P + 8 FT-N), matching the 26 ACs across the four tasks.
|
||||
|
||||
## Docker Stack Validation
|
||||
|
||||
Not run as part of this batch — same hand-off as batch 1. Step 7 (`test-run/SKILL.md`) owns the `docker compose -f docker-compose.test.yml up --build --abort-on-container-exit e2e-consumer` gate. FT-P-17 and FT-N-08 are SkippableFacts — they activate when `COMPOSE_RESTART_ENABLED=1` is set in the consumer container AND the consumer image has `docker` CLI on PATH; otherwise they emit an explicit skip reason (no silent pass).
|
||||
|
||||
## Tracker Updates
|
||||
|
||||
Per `protocols.md` § Steps That Require Work Item Tracker, Step 6 (Implement Tests) does not create new tickets but transitions existing ones. The implement skill's Step 5 (`In Progress`) and Step 12 (`In Testing`) are followed manually for AZ-577 / AZ-578 / AZ-579 / AZ-580 since the Jira MCP transitions are out of band.
|
||||
|
||||
## Next Batch
|
||||
|
||||
All 11 test tasks (AZ-576 + AZ-577..AZ-586) span two batches in the dependency table. Batch 1 covered AZ-576. Batch 2 covers AZ-577..AZ-580 (functional positive + negative). Batch 3 will cover AZ-581..AZ-586 (security NFT-SEC, resilience NFT-RES, resource limits NFT-RES-LIM, performance NFT-PERF) — these are the heavier non-functional categories. **Recommend a session break before Batch 3** per the Context Management Protocol heuristic ("more than 2 batches in one session" caution zone).
|
||||
Reference in New Issue
Block a user