When adding a new Driver, update test coverage in the same change. A new driver is not complete until all items below are done.
Queue contract mapping
- Update
TestOptionContractCoverage_AllDriversAccountedForincontract_test.go. - Ensure
runQueueContractSuite(...)runs for the driver in local and/or integration suites.
Interoperability coverage
- Add or update tests that dispatch via
Queueand consume via queue-managed workers for the driver. - Durable drivers must validate this explicitly.
Integration backend wiring
- If the driver uses external infrastructure, wire it into integration tests and backend selection.
- Keep integration runs executable with:
go test -tags integration ./integration/...
- Prefer the centralized integration driver registration helper (
integration/internal/intdrivers) instead of repeating per-test-file driver blank-import lists.
Driver-module migration
- If you change optional backend constructors/import paths, update
docs/driver-migration.mdin the same change.
CI matrix
- Ensure the integration backend matrix in
.github/workflows/test.ymlincludes the backend. - The
integration-matrix-guardjob enforces required backend entries. - Nightly/manual soak scenario runs are defined in
.github/workflows/soak.ymlwithRUN_SOAK=1. - Duration guardrail env overrides for integration scenarios are documented in
docs/integration-scenarios.md(SCENARIO_DURATION_LIMIT_SECONDS*with scenario/backend-specific precedence).
The integration scenarios suite runs for every enabled backend in integration/all/integration_scenarios_test.go under TestIntegrationScenarios_AllBackends.
Named scenarios currently enforced:
scenario_register_handlerscenario_startworkers_idempotentscenario_dispatch_burstscenario_wait_all_processedscenario_poison_message_max_retryscenario_worker_restart_recoveryscenario_bind_invalid_jsonscenario_unique_queue_scopescenario_dispatch_context_cancellationscenario_shutdown_during_delay_retryscenario_multi_worker_contentionscenario_duplicate_delivery_idempotencyscenario_dispatch_during_broker_faultscenario_consume_after_broker_recoveryscenario_ordering_contractscenario_backpressure_saturationscenario_payload_largescenario_config_option_fuzzscenario_shutdown_idempotent
Optional long-run scenario (enabled with RUN_SOAK=1):
scenario_soak_mixed_load
What these prove:
- Worker lifecycle idempotency (
StartWorkersandShutdowncan be called twice safely). - Concurrent dispatch pressure with mixed job options (
Delay,Timeout,Retry,Backoffwhere supported). - Payload decode path via
Job.Bind(...). - Poison job behavior by backend capability (retry ceiling where supported) and healthy-job recovery.
- Restart recovery only for backends that support deterministic restart durability in integration.
- Invalid JSON payload behavior through
Job.Bind(...)does not wedge workers; valid payloads still process. - Uniqueness is enforced per queue (duplicate rejected in same queue, allowed across queues).
- Dispatch context cancellation behavior is verified per backend capability, with healthy follow-up processing.
- Worker shutdown during delayed/retry workloads is exercised with restart and recovery assertions where supported.
- Multiple workers on one queue are validated against duplicate successful processing in deterministic backends.
- Duplicate-delivery idempotency patterns are exercised under forced retry to validate single side-effect commit.
- Broker fault injection/recovery is exercised on supported backends.
- FIFO ordering contract is asserted for backends marked ordering-capable.
- Backpressure saturation scenarios prove continued forward progress.
- Large payload processing is validated end-to-end.
- Config/job-option fuzz coverage validates mixed option combinations across backends for stability.
- End-to-end completion for all successfully dispatched jobs.