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
- Operator can issue an explicit read only credential —
TestOperatorCanIssueAnExplicitReadOnlyCredential - Misplaced read only flag cannot silently create a writer —
TestMisplacedReadOnlyFlagCannotSilentlyCreateAWriter
admission_test.go
- Serving refuses a pool too small to reserve another projects capacity —
TestServingRefusesAPoolTooSmallToReserveAnotherProjectsCapacity
artifacts_test.go
- Artifact limit command refuses incomplete policies before connecting —
TestArtifactLimitCommandRefusesIncompletePoliciesBeforeConnecting - Artifact operator can inspect and atomically replace storage allowances —
TestArtifactOperatorCanInspectAndAtomicallyReplaceStorageAllowances
chunkrecovery_test.go
- Chunk recovery command validates and reports content free progress —
TestChunkRecoveryCommandValidatesAndReportsContentFreeProgress
cliui_test.go
- CLI visuals adapt without losing meaning —
TestCLIVisualsAdaptWithoutLosingMeaning - CLI status renders healthy degraded completed and cancelled states —
TestCLIStatusRendersHealthyDegradedCompletedAndCancelledStates - CLI output modes and dynamic text are safe —
TestCLIOutputModesAndDynamicTextAreSafe - Display clipping counts wide and combining runes —
TestDisplayClippingCountsWideAndCombiningRunes - CLI theme configuration and cancelled activity —
TestCLIThemeConfigurationAndCancelledActivity - The progress meter refuses to invent progress —
TestTheProgressMeterRefusesToInventProgress - A narrow terminal still gets a panel wide enough to read —
TestANarrowTerminalStillGetsAPanelWideEnoughToRead - Clipping below two columns drops the marker rather than the content —
TestClippingBelowTwoColumnsDropsTheMarkerRatherThanTheContent - Every line of a panel ends in the same column —
TestEveryLineOfAPanelEndsInTheSameColumn - The terminal sanitiser removes what acts on a line without being seen —
TestTheTerminalSanitiserRemovesWhatActsOnALineWithoutBeingSeen
conformance_test.go
- Conformance command runs the suite against a live deployment —
TestConformanceCommandRunsTheSuiteAgainstALiveDeployment. The command runs the suite against a live deployment with the reference adapter and prints one verdict per case and a summary; the same deployment refuses a run with nothing to drive it. - Conformance command fails the run when a case fails —
TestConformanceCommandFailsTheRunWhenACaseFails. A driver that fails a case makes the run fail with the count, so an adapter's build goes red. - Conformance serve reference answers one report per instruction —
TestConformanceServeReferenceAnswersOneReportPerInstruction. --serve-reference is the reference over stdin and stdout: one instruction line in, one report line out, which is what an adapter's driver reproduces in its own language.
dispatch_test.go
- Every command name reaches its own command —
TestEveryCommandNameReachesItsOwnCommand
embeddingfollow_test.go
- Embedding follow uses runtime privileges and retries without leaking provider payload —
TestEmbeddingFollowUsesRuntimePrivilegesAndRetriesWithoutLeakingProviderPayload - Embedding follow refuses invalid controls before connecting —
TestEmbeddingFollowRefusesInvalidControlsBeforeConnecting - Embedding follow requires complete explicit configuration —
TestEmbeddingFollowRequiresCompleteExplicitConfiguration
embeddings_test.go
- Embedding commands build and activate explicit generations —
TestEmbeddingCommandsBuildAndActivateExplicitGenerations
entityembeddings_test.go
- Entity embedding commands manage candidates without printing source text —
TestEntityEmbeddingCommandsManageCandidatesWithoutPrintingSourceText
formation_test.go
- Formation commands validate before connecting —
TestFormationCommandsValidateBeforeConnecting - Formation commands inspect and recover without returning memory —
TestFormationCommandsInspectAndRecoverWithoutReturningMemory
health_test.go
- Health configuration and local probes refuse ambiguity —
TestHealthConfigurationAndLocalProbesRefuseAmbiguity - Operator health command returns only aggregates —
TestOperatorHealthCommandReturnsOnlyAggregates - Serving readiness distinguishes missing required worker and recovery —
TestServingReadinessDistinguishesMissingRequiredWorkerAndRecovery - Worker loopback health exposes no memory and requires its own driver —
TestWorkerLoopbackHealthExposesNoMemoryAndRequiresItsOwnDriver - Worker readiness cannot borrow another workers heartbeat —
TestWorkerReadinessCannotBorrowAnotherWorkersHeartbeat - Worker health port must be discoverable by its probe —
TestWorkerHealthPortMustBeDiscoverableByItsProbe - The probe resolves a wildcard bind to the loopback it can reach —
TestTheProbeResolvesAWildcardBindToTheLoopbackItCanReach
ingest_test.go
- Ingest stores a document as segments exactly once and refuses whole —
TestIngestStoresADocumentAsSegmentsExactlyOnceAndRefusesWhole. 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 holds —
TestIngestWaitsForCapacityThenResumesFromTheReceiptsItHolds. 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 anything —
TestIngestRefusesAMisconfiguredRunBeforeReadingAnything. 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 formed —
TestIngestReportsRefusalsByNameAndEndsTheWaitWhenFormed. 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 name —
TestIngestKeepsOneManifestPerFileNameAndRefusesTwoWithTheSameName. A manifest is named after the whole file name, so a.txt and a.md keep their own.
instance_test.go
- Default instance bootstrap restart and project creation use one memory namespace —
TestDefaultInstanceBootstrapRestartAndProjectCreationUseOneMemoryNamespace
main_test.go
- Starting without required configuration is refused —
TestStartingWithoutRequiredConfigurationIsRefused. Each of these is a way for a deployment to be wrong, and each has to stop the process rather than be defaulted into something that happens to run. - The registry connection cannot be arrived at by omission —
TestTheRegistryConnectionCannotBeArrivedAtByOmission. The registry connection is required separately, and this is the one worth its own test. - An unusable schema name is refused at startup —
TestAnUnusableSchemaNameIsRefusedAtStartup. A schema name is interpolated rather than bound, so an unusable one is refused before it reaches a statement rather than after. - An unreachable database stops the process starting —
TestAnUnreachableDatabaseStopsTheProcessStarting. A database that cannot be reached is a startup failure, not a runtime surprise. - It serves and shuts down when its context ends —
TestItServesAndShutsDownWhenItsContextEnds. The whole of run: it starts, serves, and stops when its context ends. - A port already in use stops the process starting —
TestAPortAlreadyInUseStopsTheProcessStarting. A port already in use is a startup failure with a reason, rather than a goroutine that dies while the process reports itself started. - The bundle budget falls back rather than failing —
TestTheBundleBudgetFallsBackRatherThanFailing. The bundle budget falls back rather than failing, because a malformed number is a deployment typo and refusing to start over one is worse than a default an operator can see in the log. - The binary exits non zero when it fails —
TestTheBinaryExitsNonZeroWhenItFails. ── main itself ─────────────────────────────────────────────────────────────────────────────── Re-executed as a subprocess, because what is asserted is the EXIT STATUS — the contract main has with whatever supervises it, and the thing that cannot be observed from inside the process that would be exiting. - No subcommand means serve —
TestNoSubcommandMeansServe. No subcommand means serve, because the container's command is the common case and a deployment that has to remember the word is one that fails at start with a usage message. - An unknown command is an error —
TestAnUnknownCommandIsAnError - Bootstrap is idempotent and mints one credential —
TestBootstrapIsIdempotentAndMintsOneCredential. Bootstrap brings an empty database to a state that can serve, and it does so twice. - Bootstrap refuses without the identity passwords —
TestBootstrapRefusesWithoutTheIdentityPasswords. The passwords for the two database identities have no default, because a default is a credential that works because nobody chose one. - Creating a project is repeatable —
TestCreatingAProjectIsRepeatable. Creating a project is a controlled operation, and creating one twice is not a failure — the chart and the compose file both run it on every start. - A credential can be minted and revoked from the command line —
TestACredentialCanBeMintedAndRevokedFromTheCommandLine. A credential can be minted and revoked from the command line, which is how an operator recovers from a lost token without a portal. - A configured model starts the formation driver —
TestAConfiguredModelStartsTheFormationDriver. With a model configured, the process starts the formation driver alongside the server. - The operator commands refuse missing configuration —
TestTheOperatorCommandsRefuseMissingConfiguration. The operator commands refuse the same configuration mistakes the server does, and say which. - Each command says what it wanted when called bare —
TestEachCommandSaysWhatItWantedWhenCalledBare. Each command states its own usage when called with nothing, because a baretaisce projectthat silently does nothing is worse than one that says what it wanted. - A credential cannot be minted for a project that does not exist —
TestACredentialCannotBeMintedForAProjectThatDoesNotExist. A credential cannot be minted for a project that does not exist. - The API role serves without forming —
TestTheAPIRoleServesWithoutForming. The api role serves and does not form. - The worker role forms without serving memory —
TestTheWorkerRoleFormsWithoutServingMemory. The worker role forms and binds nothing. - An unknown role is refused —
TestAnUnknownRoleIsRefused. A role nobody defined is refused rather than defaulted. - A project name that cannot be an identifier is refused —
TestAProjectNameThatCannotBeAnIdentifierIsRefused. A project name that cannot be an identifier is refused. - A project can be suspended and resumed —
TestAProjectCanBeSuspendedAndResumed. Suspending and resuming a project from the command line. - The binary reports its version —
TestTheBinaryReportsItsVersion. The binary says what it is, and says "unknown" rather than guessing. - Audit seal and verify from the command line —
TestAuditSealAndVerifyFromTheCommandLine. The operator's own check on their own ledger, from the command line.
manage_test.go
- The manage role serves the management surface and nothing else —
TestTheManageRoleServesTheManagementSurfaceAndNothingElse. The manage role serves the management surface on its own listener with the administrative connection, and nothing else: no memory route answers there, and the door opens for an operator credential only. - The operator commands speak the management surface when configured —
TestTheOperatorCommandsSpeakTheManagementSurfaceWhenConfigured. The operator commands speak the management surface when it is configured, print the same lines the direct path prints, and refuse to speak it without an operator credential. - An unreachable management surface is an error —
TestAnUnreachableManagementSurfaceIsAnError. A management surface that cannot be reached is an error a person can read, not a hang. - Operator issue mints an operator credential over the administrative connection —
TestOperatorIssueMintsAnOperatorCredentialOverTheAdministrativeConnection. An operator credential is minted over the administrative connection, and it opens the operator door: the one operation that exists before the surface can be spoken to. - A management answer that is not a refusal is reported by status —
TestAManagementAnswerThatIsNotARefusalIsReportedByStatus. A surface that answers with something other than its own refusal shape is reported by status, so a proxy's error page does not read as the surface's word. - The manage role refuses to start without the administrative connection —
TestTheManageRoleRefusesToStartWithoutTheAdministrativeConnection. The manage role holds the administrative connection or does not start.
passages_test.go
- Passage configuration requires explicit valid revision —
TestPassageConfigurationRequiresExplicitValidRevision - Worker does not require passage API configuration —
TestWorkerDoesNotRequirePassageAPIConfiguration - Candidate search requires the same explicit opt in as passage search —
TestCandidateSearchRequiresTheSameExplicitOptInAsPassageSearch
privileges_test.go
- Reserved memory namespaces are refused before connecting —
TestReservedMemoryNamespacesAreRefusedBeforeConnecting - Serving with administrative memory credentials is refused —
TestServingWithAdministrativeMemoryCredentialsIsRefused - Serving with administrative registry credentials is refused —
TestServingWithAdministrativeRegistryCredentialsIsRefused - Non owner runtime roles can authenticate store export and erase —
TestNonOwnerRuntimeRolesCanAuthenticateStoreExportAndErase
projectrebuild_test.go
- Project rebuild commands validate before connecting —
TestProjectRebuildCommandsValidateBeforeConnecting - Project rebuild commands provide progress and cancellation without a provider —
TestProjectRebuildCommandsProvideProgressAndCancellationWithoutAProvider
rebuild_test.go
- Rebuild command validates before connecting —
TestRebuildCommandValidatesBeforeConnecting - Rebuild command replays committed generation —
TestRebuildCommandReplaysCommittedGeneration
rebuildstaleness_test.go
- A rebuilds own fields stay where they are and staleness is added beside them —
TestARebuildsOwnFieldsStayWhereTheyAreAndStalenessIsAddedBesideThem. ── 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
- Recovery command rejects invalid requests before connecting —
TestRecoveryCommandRejectsInvalidRequestsBeforeConnecting - Recovery command restores one source and returns only progress —
TestRecoveryCommandRestoresOneSourceAndReturnsOnlyProgress
reportembeddings_test.go
- Report embedding commands manage themes without printing build input —
TestReportEmbeddingCommandsManageThemesWithoutPrintingBuildInput
reportrebuild_test.go
- Rebuild reports closes the window and says what is left —
TestRebuildReportsClosesTheWindowAndSaysWhatIsLeft. ── 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 there —
TestRebuildReportsRendersForATerminalAndRefusesAProjectThatIsNotThere. 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 anything —
TestRebuildReportsRefusesAnUnusableRequestBeforeCallingAnything. 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 budget —
TestRebuildReportsHonoursTheOperatorsTurnBudget. 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 bound —
TestTheTurnBudgetIsAnOperatorSettingAndRefusesWhatCannotBound. 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 serves —
TestTheHelpNamesEveryCommandTheBinaryServes. Every command the binary serves is intaisce help, in its plain and its terminal form, and answerstaisce <command> --helpwith its own lines. - Asking a command for help prints its lines without connecting —
TestAskingACommandForHelpPrintsItsLinesWithoutConnecting. 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 log —
TestACommandFailureIsWrittenToStderrAndTheServersToItsLog. 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.