Snodo.Extensions.Tasks.Store.ContractTest (snodo_tasks v0.3.1)

Copy Markdown View Source

Reusable ExUnit checks for a Snodo.Extensions.Tasks.Store implementation.

Use this module inside an ExUnit.Case and pass :start_store, an arity-2 function receiving the test context and store options. It must return a fresh {module, state} reference. The suite passes :max_tasks and :max_active_tasks_per_scope to check capacity. Start a store with a scope function based on context.auth["tenant"]; each test uses distinct tenant values. The function may register cleanup with on_exit/1.

use ExUnit.Case, async: false
use Snodo.Extensions.Tasks.Store.ContractTest,
  start_store: &__MODULE__.start_contract_store/2

The suite checks the public store boundary. Run backend-specific persistence, restart, database transaction, and stress tests alongside it.

Summary

Functions

Injects the shared store contract tests into an ExUnit case.

Functions

__using__(opts)

(macro)

Injects the shared store contract tests into an ExUnit case.