Documentation
¶
Overview ¶
Package storetest is the test every CronWatch store passes: the memory store, and the sqlstore package on SQLite, Postgres and MySQL. It is the SDK's store-conformance.ts, and a replay of the store cases in the repository's conformance/store.json. Run it against a store of your own:
func TestMyStore(t *testing.T) {
storetest.Run(t, func(t *testing.T) cronwatch.Store { return mystore.New(...) })
}
Index ¶
- Constants
- func FinishOnce(t *testing.T, shared func(t *testing.T) Shared)
- func NewRun(id, job string, status cronwatch.RunStatus, startedAt int64) cronwatch.Run
- func NewRunPlain(id, job string, status cronwatch.RunStatus, startedAt int64) cronwatch.Run
- func ReplayFixture(t *testing.T, path string, newStore func(t *testing.T) cronwatch.Store)
- func Run(t *testing.T, newStore func(t *testing.T) cronwatch.Store)
- type Capture
- type Clock
- type Errors
- type Process
- type Shared
Constants ¶
const T0 int64 = 1767605400000
T0 is Monday 2026-01-05 09:30:00Z, the SDK tests' clock start.
Variables ¶
This section is empty.
Functions ¶
func FinishOnce ¶
FinishOnce is finish-once.test.ts's tests over several stores sharing one database: however many processes finish a run, it is recorded and judged once. shared makes a fresh database each time it is called.
func NewRun ¶
NewRun is a run as the contract test writes them: finished ten milliseconds after it started unless it is running, with one metric.
func NewRunPlain ¶
NewRunPlain is the fixture script's run: as NewRun, with no metrics.
func ReplayFixture ¶
ReplayFixture replays the store cases of conformance/store.json (at path) against stores from newStore, which must each be empty: prune scripts, CompareAndSetState steps and UpdateRunIf steps, each read back and compared with what the SDK's memory store answered.
Types ¶
type Capture ¶
Capture is a channel that keeps the alerts it is sent.
type Clock ¶
type Clock struct {
// contains filtered or unexported fields
}
Clock is a settable clock for a client.
type Errors ¶
type Errors struct {
// contains filtered or unexported fields
}
Errors keeps what a client reports, as "where: message".