Skip to main content

Tests: internal/conformance

internal/conformance · 13 tests

Each test is named for the property it holds, and runs against a real deployment: there is no mock of the database and no arm that skips when it is absent. The sentence is the test's name read back; the name is what go test -run takes.

conformance_test.go

  • MainTestMain
  • The reference adapter passes every caseTestTheReferenceAdapterPassesEveryCase. The suite passes with an adapter that keeps every rule, against a live deployment, with the memory message carrying the seeded fact, the watermark and the plan.
  • The suite refuses each broken ruleTestTheSuiteRefusesEachBrokenRule. Every rule is one the suite has been seen to refuse: an adapter that breaks it fails the case that holds it, by name, and passes the others.
  • A driver over the subprocess protocol passesTestADriverOverTheSubprocessProtocolPasses. The subprocess protocol carries the whole suite: the reference served over stdio by this test binary passes every case exactly as it does in-process.
  • The memory message is one renderingTestTheMemoryMessageIsOneRendering. The memory message is one rendering: what the reference renders is what the parser reads, and anything else is not a memory message.
  • A mismatched suite file is refusedTestAMismatchedSuiteFileIsRefused. A suite file with a field this runner does not know, another prefix, or no cases is refused, so a suite and a runner that disagree cannot produce a passing run of nothing.
  • A run the deployment refuses stops with the reasonTestARunTheDeploymentRefusesStopsWithTheReason. A run whose seeding or reading the deployment refuses stops with the reason rather than judging a turn against a deployment it could not prepare: a credential the deployment does not know, and a seed with a relation the vocabulary refuses.
  • An unreadable watermark stops the runTestAnUnreadableWatermarkStopsTheRun. A credential the deployment refuses stops a seedless case at the first read: freshness answers with its status and the run says so.

judge_test.go

  • The judge names every broken ruleTestTheJudgeNamesEveryBrokenRule. Every refusal the judge can make is watched being made, from a report that breaks each rule in turn: a memory message that does not parse, one with the wrong role, one unmarked, one missing its watermark, plan or facts, a turn that was fatal, a store error where none was expected, an observe body that does not parse, the wrong roles, the wrong contents, and a stored count that is not the expected one.
  • The runner and the protocol refuse what they cannot useTestTheRunnerAndTheProtocolRefuseWhatTheyCannotUse. The runner's own refusals: a deployment address that is not a URL, a driver that cannot start, a driver that answers something that is not a report, an instruction the served side cannot parse, a served driver that fails, and a memory message whose parts are not JSON.
  • A run against nothing stops before any turnTestARunAgainstNothingStopsBeforeAnyTurn. A deployment nobody answers at stops the run before any turn, and closing a driver that never started is nothing.
  • The runners own reads retry an admission refusal and stop when the context endsTestTheRunnersOwnReadsRetryAnAdmissionRefusalAndStopWhenTheContextEnds. The runner's own reads are retried when the deployment's admission gate refuses them: a 429 on the freshness read or the seed is the deployment being busy, not the adapter breaking a rule.
  • The judge holds groups retries and keys to their rulesTestTheJudgeHoldsGroupsRetriesAndKeysToTheirRules