Skip to content

Improve Fleet-Ops server test coverage#277

Draft
roncodes wants to merge 141 commits into
mainfrom
feature/fleetops-server-coverage-100
Draft

Improve Fleet-Ops server test coverage#277
roncodes wants to merge 141 commits into
mainfrom
feature/fleetops-server-coverage-100

Conversation

@roncodes

@roncodes roncodes commented Jul 19, 2026

Copy link
Copy Markdown
Member

Summary

  • Continues the backend-only Fleet-Ops coverage push toward the enforced 100% server coverage gate.
  • Keeps new and touched coverage organized under categorized directories such as server/tests/Unit/... and server/tests/Feature/... instead of adding more flat files under server/tests.
  • Adds focused Zone model coverage for service-area relationship metadata, static type accessors, GEOS polygon conversion boundaries that do not require local GEOS extension classes, and generated spatial polygon closure.
  • Adds focused WorkOrder model coverage for relationship contracts, activity logging options, assignment lifecycle updates, guarded lifecycle transitions, checklist completion fallbacks, schedule helpers, overdue checks, and priority predicates.
  • Adds categorized Unit/Notifications coverage for terminal order completion/failure mail payloads, database array payloads, terminal titles/messages, reason propagation, console URL construction, and tracking-number fallback behavior.
  • Adds categorized Unit/Constraints, Unit/Jobs, and Unit/Support/Analytics coverage for HOS validation outcomes, simulated waypoint event payloads, and geofence violation dashboard summaries.
  • Adds categorized Unit/Tracking coverage for tracking route-point resolution, routeability checks, and state-signature behavior, while extending dispatch notification mail coverage for waypoint tracking fallbacks.
  • Adds focused Equipment model coverage for relationship contracts, morph assignment normalization, appended accessors, query scopes, assignment activity payloads, maintenance helpers, replacement-cost estimates, and import row hydration.
  • Moves the LiveController viewport coverage from a flat root test into server/tests/Feature/Http/Internal/LiveControllerTest.php.
  • Preserves the CI coverage contract: Clover reporting is generated locally and the 100% fail-under gate is wired and currently fails because total backend coverage is not yet 100%.

Current Coverage

Latest locally verified backend coverage from composer coverage:baseline:

Metric Coverage Covered / Total
Lines 74.02% 25,230 / 34,086
Methods 61.83% 2,684 / 4,341
Classes 34.74% 181 / 521

Targeted file progress:

File Coverage Covered / Total
server/src/Models/Zone.php 71.05% 27 / 38 lines
server/src/Models/WorkOrder.php 87.50% 168 / 192 lines
server/src/Models/Equipment.php 88.82% 143 / 161 lines
server/src/Models/Payload.php 47.23% 196 / 415 lines
server/src/Notifications/OrderCompleted.php 70.00% 21 / 30 lines
server/src/Notifications/OrderFailed.php 68.75% 22 / 32 lines
server/src/Constraints/HOSConstraint.php 91.57% 76 / 83 lines
server/src/Jobs/SimulateWaypointReached.php 100.00% 6 / 6 lines
server/src/Support/Analytics/GeofenceViolations.php 100.00% 44 / 44 lines
server/src/Tracking/TrackingContext.php 100.00% 19 / 19 lines
server/src/Notifications/OrderDispatched.php 61.22% 30 / 49 lines

Previous locally reported backend line coverage was 73.98%, so this slice raises total backend line coverage by 0.04 percentage points. The newest local commits remain unpushed for now because the increase is below the agreed 5-10% push threshold.

Validation

  • php -l server/tests/Feature/Http/Internal/LiveControllerTest.php
  • php -l server/tests/Unit/Models/EquipmentTest.php
  • php -l server/tests/Unit/Models/WorkOrderTest.php
  • php -l server/tests/Unit/Models/ZoneTest.php
  • php -l server/tests/Unit/Notifications/TerminalOrderNotificationsTest.php
  • php -l server/tests/Unit/Constraints/HOSConstraintTest.php
  • php -l server/tests/Unit/Jobs/SimulateWaypointReachedTest.php
  • php -l server/tests/Unit/Support/Analytics/GeofenceViolationsTest.php
  • php -l server/tests/Unit/Tracking/TrackingContextTest.php
  • php -d memory_limit=-1 scripts/pest-runner.php --colors=always server/tests/Feature/Http/Internal/LiveControllerTest.php
  • php -d memory_limit=-1 scripts/pest-runner.php --colors=always server/tests/Unit/Models/EquipmentTest.php
  • php -d memory_limit=-1 scripts/pest-runner.php --colors=always server/tests/Unit/Models/WorkOrderTest.php
  • php -d memory_limit=-1 scripts/pest-runner.php --colors=always server/tests/Unit/Models/ZoneTest.php
  • php -d memory_limit=-1 scripts/pest-runner.php --colors=always server/tests/Unit/Notifications/TerminalOrderNotificationsTest.php
  • php -d memory_limit=-1 scripts/pest-runner.php --colors=always server/tests/Unit/Constraints/HOSConstraintTest.php
  • php -d memory_limit=-1 scripts/pest-runner.php --colors=always server/tests/Unit/Jobs/SimulateWaypointReachedTest.php
  • php -d memory_limit=-1 scripts/pest-runner.php --colors=always server/tests/Unit/Support/Analytics/GeofenceViolationsTest.php
  • php -d memory_limit=-1 scripts/pest-runner.php --colors=always server/tests/Unit/Tracking/TrackingContextTest.php
  • vendor/bin/pest --colors=always server/tests/Unit/Tracking/TrackingContextTest.php server/tests/Unit/Notifications/TerminalOrderNotificationsTest.php
  • composer test:lint
  • composer test:unit
  • composer coverage:baseline
  • php scripts/coverage-summary.php coverage/clover.xml --fail-under=100
  • git diff --check
  • git diff --cached --check

Notes

  • The 100% coverage gate is intentionally still failing at 74.02% line coverage.
  • The latest local commits have not been pushed because they do not meet the requested significant-progress threshold for pushing.
  • Additional backend coverage slices will continue to land locally and the PR will be pushed after a meaningful coverage increase.

roncodes added 30 commits July 26, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant