Skip to main content

Module testing

Module testing 

Source
Expand description

Test-only constructors, seed helpers and dispatch interception for Workspace, so tests here and cross-crate tests can drive a workspace without a real subprocess.

Re-exportsΒ§

use std::collections::HashMap; πŸ”’
use std::collections::HashSet; πŸ”’
use std::path::PathBuf; πŸ”’
use std::sync::Arc; πŸ”’
use parking_lot::Mutex; πŸ”’
use tokio::sync::mpsc; πŸ”’
use crate::config::LoadedConfig; πŸ”’
use crate::domain_session::PendingInteractions; πŸ”’
use crate::protocol::SessionUpdate; πŸ”’
use crate::target::ProjectKey; πŸ”’
use crate::target::SessionSlot; πŸ”’
use crate::update_fanout::SeatUpdate; πŸ”’
use crate::update_fanout::SubscriberRole; πŸ”’
use crate::update_fanout::UpdateFanout; πŸ”’
use crate::workspace::KickRequest; πŸ”’
use crate::workspace::PendingInteractionKind; πŸ”’
use crate::workspace::PooledAgent; πŸ”’
use crate::workspace::Workspace; πŸ”’
use forge_gateway::AccountKey; πŸ”’
use forge_primitives::SessionId; πŸ”’

ConstantsΒ§

TEST_DOCUMENT_PATH πŸ”’
The path a seeded document hand-off parks at. The registration IS the state a seeder produces - nothing reads the file - so the fixture names one rather than touching disk.
TEST_TOOL_ID
The tool id a parked test prompt answers to, so a test addresses the one it seeded rather than a key it has to know how the fixture built.

FunctionsΒ§

set_seat_ring_cap
Drive a seat’s frame window down, so a fixture reaches the transcript fallback without emitting a window’s worth of frames. The window is otherwise the constant it ships as, and the module this sits in is the gate that keeps it out of production.
test_permission πŸ”’
A permission prompt for a fixture to park on a seat: the smallest one a dock can draw, carrying the id TEST_TOOL_ID answers to. A fixture is the only place a prompt is invented, so it says what it invents.
test_prompt πŸ”’
test_permission or test_question with a receiver nobody keeps.
test_question πŸ”’
The same, for a question.
test_tool_call πŸ”’
The tool call a fixture’s prompt is about.