Add deterministic client integration diagnostics
This commit is contained in:
parent
eb9355b003
commit
fb0df5e4a1
15 changed files with 6193 additions and 18 deletions
1264
tests/test_client_integration.py
Normal file
1264
tests/test_client_integration.py
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -34,6 +34,10 @@ from docforge.viewer_manager import ViewerManagerClient
|
|||
ROOT = Path(__file__).resolve().parents[1]
|
||||
FIXTURES = ROOT / "tests" / "fixtures"
|
||||
RESULT_SCHEMA = json.loads((ROOT / "schemas" / "result.schema.json").read_text())
|
||||
CLIENT_CONFIGURATION_SCHEMA = json.loads(
|
||||
(ROOT / "schemas" / "client-configuration.schema.json").read_text()
|
||||
)
|
||||
DOCTOR_RESULT_SCHEMA = json.loads((ROOT / "schemas" / "doctor-result.schema.json").read_text())
|
||||
ZERO_WORK_COUNTERS = (
|
||||
"project_loads",
|
||||
"source_files_parsed",
|
||||
|
|
@ -134,6 +138,16 @@ class TelemetryContractTests(unittest.TestCase):
|
|||
set(COUNTER_NAMES),
|
||||
set(properties["counters"]["properties"]),
|
||||
)
|
||||
for schema in (CLIENT_CONFIGURATION_SCHEMA, DOCTOR_RESULT_SCHEMA):
|
||||
dedicated = schema["$defs"]["diagnostics"]["properties"]
|
||||
self.assertEqual(
|
||||
set(STAGE_NAMES),
|
||||
set(dedicated["stages"]["propertyNames"]["enum"]),
|
||||
)
|
||||
self.assertEqual(
|
||||
set(COUNTER_NAMES),
|
||||
set(dedicated["counters"]["required"]),
|
||||
)
|
||||
|
||||
def test_thread_and_async_request_contexts_are_isolated(self) -> None:
|
||||
barrier = threading.Barrier(2)
|
||||
|
|
|
|||
|
|
@ -61,6 +61,8 @@ PUBLIC_IMPORTS = {
|
|||
"CanonicalApplicationService",
|
||||
"GenericCanonicalApplier",
|
||||
),
|
||||
"docforge.client_config": ("generate_client_configuration",),
|
||||
"docforge.doctor": ("run_doctor",),
|
||||
"docforge.index": ("ProjectIndex",),
|
||||
"docforge.mcp_server": (
|
||||
"create_project_server",
|
||||
|
|
@ -108,8 +110,10 @@ EXPECTED_CLI_COMMANDS = {
|
|||
"backlinks",
|
||||
"build",
|
||||
"check",
|
||||
"configure",
|
||||
"context",
|
||||
"dependencies",
|
||||
"doctor",
|
||||
"filter",
|
||||
"generation-diff",
|
||||
"impact",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue