feat(testing): run the golden cookbook suite without an API key - #201
Open
s-alexey wants to merge 1 commit into
Open
feat(testing): run the golden cookbook suite without an API key#201s-alexey wants to merge 1 commit into
s-alexey wants to merge 1 commit into
Conversation
The golden tests were the only end-to-end coverage of the harness — tasks, schema parsing, tool loops, chatrooms, assertions — and every one of them needed a live model. They could not run on a branch, so that coverage never gated a change, and each task definition was locked inside the single 1500-line test module. Add a public ScriptedLLM that replays canned responses at the invoke() boundary. Because it plugs in below respond(), a scripted run still goes through the real path: schema parsing, assertions, chat history and serialization all behave as they would against a live backend, just offline and deterministically. tests/mocks.py's MockedChat becomes a thin alias. Split the cookbook into one file per theme. Each file holds its tasks, and under each task the two tests that exercise it: a scripted one that runs anywhere, and a live one parametrized over a model pool. Tests asserting a failure are scripted only — a real model may legitimately answer correctly. Scenarios whose input needs the network, or that verify provider wiring, stay live-only: faking those would assert nothing. Model pools come from a table where each model is named once alongside what it can be used for, replacing per-feature name sets that had drifted out of sync. A pool is empty when no provider is configured, so live tests skip on an empty parameter set and the suite stays green without credentials — no marker or skip machinery. Wire the suite into CI, and run it in TESTING mode: the default client serializes every task and run to JSON in the working directory, which left 183 files behind and dominated the runtime. Offline: 43 tests, no credentials. Live selection is unchanged from the previous suite at 476 model-parametrized tests.
s-alexey
force-pushed
the
golden_tests
branch
from
September 1, 2026 14:24
c7a2723 to
7a62a60
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The golden tests were the only end-to-end coverage of the harness — tasks, schema parsing, tool loops, chatrooms, assertions — and every one of them needed a live model. They could not run on a branch, so that coverage never gated a change, and each task definition was locked inside the single 1500-line test module.
Add a public ScriptedLLM that replays canned responses at the invoke() boundary. Because it plugs in below respond(), a scripted run still goes through the real path: schema parsing, assertions, chat history and serialization all behave as they would against a live backend, just offline and deterministically. tests/mocks.py's MockedChat becomes a thin alias.
Split the cookbook into one file per theme. Each file holds its tasks, and under each task the two tests that exercise it: a scripted one that runs anywhere, and a live one parametrized over a model pool. Tests asserting a failure are scripted only — a real model may legitimately answer correctly. Scenarios whose input needs the network, or that verify provider wiring, stay live-only: faking those would assert nothing.
Model pools come from a table where each model is named once alongside what it can be used for, replacing per-feature name sets that had drifted out of sync. A pool is empty when no provider is configured, so live tests skip on an empty parameter set and the suite stays green without credentials — no marker or skip machinery.
Wire the suite into CI, and run it in TESTING mode: the default client serializes every task and run to JSON in the working directory, which left 183 files behind and dominated the runtime.
Offline: 43 tests, no credentials. Live selection is unchanged from the previous suite at 476 model-parametrized tests.