Skip to main content

Tests: cmd/taisce

cmd/taisce · 94 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.

access_test.go

admission_test.go

artifacts_test.go

chunkrecovery_test.go

cliui_test.go

conformance_test.go

dispatch_test.go

embeddingfollow_test.go

embeddings_test.go

entityembeddings_test.go

formation_test.go

health_test.go

ingest_test.go

  • Ingest stores a document as segments exactly once and refuses wholeTestIngestStoresADocumentAsSegmentsExactlyOnceAndRefusesWhole. A document becomes one observation per segment under the tool role with the time it says it happened; the stored messages, read back in order, are the document byte for byte; a refused file stores nothing and the run says so; running again stores nothing new and answers with the same observations, which is what resumable and duplicate-safe mean here.
  • Ingest waits for capacity then resumes from the receipts it holdsTestIngestWaitsForCapacityThenResumesFromTheReceiptsItHolds. A full backlog stops a document with the receipts it has, and the next run carries on from the API's own idempotency: the segment already received is a replay, the rest are stored, and no segment is stored twice.
  • Ingest refuses a misconfigured run before reading anythingTestIngestRefusesAMisconfiguredRunBeforeReadingAnything. The command refuses to start without an API address, without a credential in the environment, with a role that is not a speaker a document can have, or with a time it cannot parse.
  • Ingest reports refusals by name and ends the wait when formedTestIngestReportsRefusalsByNameAndEndsTheWaitWhenFormed. The API's refusals and the transport's failures reach the operator by name and store nothing: a credential the API does not know, an address nothing answers at, a manifest directory that cannot be written, a document whose whitespace cannot be segmented.
  • Ingest keeps one manifest per file name and refuses two with the same nameTestIngestKeepsOneManifestPerFileNameAndRefusesTwoWithTheSameName. A manifest is named after the whole file name, so a.txt and a.md keep their own.

instance_test.go

main_test.go

manage_test.go

passages_test.go

privileges_test.go

projectrebuild_test.go

rebuild_test.go

rebuildstaleness_test.go

  • A rebuilds own fields stay where they are and staleness is added beside themTestARebuildsOwnFieldsStayWhereTheyAreAndStalenessIsAddedBesideThem. ── A rebuild says what it left behind, at the command ──────────────────────────────────────── The staleness section is added beside the rebuild's own result, never around it: an operator scripts against this output, and moving a field somebody already reads to make room for a new one is the wrong way round.

recovery_test.go

reportembeddings_test.go

reportrebuild_test.go

  • Rebuild reports closes the window and says what is leftTestRebuildReportsClosesTheWindowAndSaysWhatIsLeft. ── A report carries what wrote it, at the command ──────────────────────────────────────────── A report is deleted when the facts under it change and the worker writes it back a few per tick, so there is a window in which a recall that would return a theme returns nothing.
  • Rebuild reports renders for a terminal and refuses a project that is not thereTestRebuildReportsRendersForATerminalAndRefusesAProjectThatIsNotThere. The fancy form is what an operator at a terminal sees, and it says which of three things happened rather than printing a count they have to interpret.
  • Rebuild reports refuses an unusable request before calling anythingTestRebuildReportsRefusesAnUnusableRequestBeforeCallingAnything. The bounds are refused before the provider is reached or the pool is opened, so a mistyped limit costs nothing and a project that is not there is not a model call.
  • Rebuild reports honours the operators turn budgetTestRebuildReportsHonoursTheOperatorsTurnBudget. The operator's turn budget bounds a report as it bounds an extraction, and the command reads it before it connects: a budget that cannot be a bound is refused rather than ignored, which is how a mistyped setting is found at the command rather than in a half-run pass.

turnbudget_test.go

  • The turn budget is an operator setting and refuses what cannot boundTestTheTurnBudgetIsAnOperatorSettingAndRefusesWhatCannotBound. The budget is the operator's only bound on a document-sized turn, so it must be honoured when set, kept at the default when absent, and refused rather than ignored when it cannot be a bound.

usage_test.go

  • The help names every command the binary servesTestTheHelpNamesEveryCommandTheBinaryServes. Every command the binary serves is in taisce help, in its plain and its terminal form, and answers taisce <command> --help with its own lines.
  • Asking a command for help prints its lines without connectingTestAskingACommandForHelpPrintsItsLinesWithoutConnecting. Help is answered before anything is configured or connected: with no database and no management surface, a command asked for help prints its own lines and succeeds, wherever the flag appears.
  • A command failure is written to stderr and the servers to its logTestACommandFailureIsWrittenToStderrAndTheServersToItsLog. A command's failure goes to stderr and leaves stdout to the command's output, so a script parsing stdout never reads the failure as data.