test(runtime): reach the runtime and the store through one harness #39

Merged
james.maes merged 13 commits from test/2.0-runtime-harness-20261110 into release/2.0 2026-11-11 01:06:00 +00:00
13 Commits
Author SHA1 Message Date
james.maesandClaude Fable 5.2 78a0de0e67 test(runtime): forward download pacing through the harness
The download-pacing tests that arrived with the runtime seam call the
runtime through the fixture; the harness now forwards that one member.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-11-10 18:45:13 -06:00
james.maesandClaude Fable 5.2 2e7f21a6c9 test(runtime): name the store's type by one alias in the test project
Tests declared the store by the product type's name in 104 lines of
25 files, so the step that renames that type would have edited all of
them. TestState.cs now declares the alias JournalStore, and every test
and fixture uses it. The product type's name appears in the test
project only in TestState.cs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-11-10 18:44:55 -06:00
james.maesandClaude Fable 5.2 c324b40e1b test(runtime): hold no job for an unset queue, and test the printer by what it counts
With no queue named, a job that names no printer compared equal to
the unset switch and was held. The switch is now compared only when
set, with a test. The test of the held queue reads the submission and
print counts instead of the entry signal, which either queue raises,
and says that it drives the printer directly.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-11-10 18:44:53 -06:00
james.maesandClaude Fable 5.2 608c609668 test(runtime): prove two scripted servers apart, and refuse a misrouted request
The first test of two servers checked the second's queue after the
first's only job had been claimed, so it passed with a shared queue.
The queues are now compared while the job is still queued, and the
tests go on to what a fixture with several servers leans on: each
server's claimed job, its acknowledged connection, a hold and a
refusal set on one, and closing one while the other answers.

The HTTP handler now refuses and counts a request addressed to another
server's origin, so a session built on the wrong server's handler
shows at once. The private fields of the server and its connection
get their summaries.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-11-10 18:44:50 -06:00
james.maesandClaude Fable 5.2 d9e7a89bcb test(runtime): refuse the installed service's pipe name in the harness
The harness said its pipe is never the installed service's, but a
caller could pass that name. The constructor now refuses it, in any
letter case, before the runtime is built, and a test shows it. The
harness's private field gets its summary.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-11-10 18:44:46 -06:00
james.maesandClaude Fable 5.2 4f9f31a5d3 test(runtime): show that the synthetic printer holds one queue while the other prints
A direct test of the fake: with BlockPrinter set, a submission to the
named queue stays inside the printer, a later submission to the other
queue finishes, and the held one finishes only when released.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-11-10 18:44:43 -06:00
james.maesandClaude Fable 5.2 0989772739 test(runtime): say where the harness keeps the runtime's constants and functions
The summary placed both at the end of the file; the constants are at
the top.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-11-10 18:44:41 -06:00
james.maesandClaude Fable 5.2 2f388bf33d docs(development): describe the runtime harness, the scripted server and TestState
The section on testing the service runtime now names the three test
helpers a new test goes through: SingleServerHarness for the runtime,
ScriptedPrintServer for the server, and TestState for a store or a
connection of the test's own to a journal, which must be unpooled.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-11-10 18:44:38 -06:00
james.maesandClaude Fable 5.2 7b36c07dc3 test(runtime): let the synthetic printer hold one queue while the other prints
BlockPrinter names a printer whose submissions stay inside the fake
until they are released, while submissions to the other queue pass
through. BlockPrint, which holds everything, is unchanged. No test
uses the new switch yet; the tests of claiming for an idle printer
while another is busy need it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-11-10 18:44:36 -06:00
james.maesandClaude Fable 5.2 f5ccdea82a test(runtime): give tests an unpooled journal connection from one helper
Six places in five test files opened their own SQLite connection to a
journal, to seed rows or to damage the schema. Those connections used
the same pool as the stores on that journal without taking the
journal's schema lock, so the pool race the store's lock closes was
still open to them. TestState.OpenJournal opens such a connection with
pooling off, and each of those places now gets its connection there.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-11-10 18:44:32 -06:00
james.maesandClaude Fable 5.2 0d5853de1b test(runtime): open the store through TestState
TestState.OpenStore is now the only place the test project constructs
AgentStore: 101 constructions in 24 files become calls to it, and the
store's static lock and connection-string lookups are read through it
too. Tests still declare the store by its type, because the build
refuses var where the type is not apparent. When the store is opened
for one server out of a registry, the constructor call changes in one
file.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-11-10 18:44:29 -06:00
james.maesandClaude Fable 5.2 f6f8c59be2 test(runtime): reach the runtime through one single-server harness
SingleServerHarness wraps the runtime for the one-server case and is
now the only test type that names AgentRuntime: the fixtures build it,
tests hold it, and the constants and pure functions tests read from
the runtime class are read from it. It makes the management pipe
itself, so the tests that built a pipe by hand, or wrote a command to
it by hand, ask the harness instead. When the runtime becomes a host
with one connection per server, this file changes and the tests do not.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-11-10 18:44:27 -06:00
james.maesandClaude Fable 5.2 ec5a225f55 test(runtime): take the scripted server out of the realtime fixture
The realtime peer, the HTTP handler, the job queue and the accepted
connections become ScriptedPrintServer, which knows nothing about the
runtime it answers. RealtimeRuntimeFixture keeps one and passes through
the members tests use, so a later fixture can put several servers
behind one service. Tests name the connection type by its new home;
nothing else in them changes. One new test shows two servers share no
state.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-11-10 18:44:22 -06:00