3f14cbbf7e
CI / lint (pull_request) Successful in 40s
CI / security (pull_request) Successful in 32s
CI / quality (pull_request) Successful in 42s
CI / typecheck (pull_request) Successful in 1m1s
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 14s
CI / unit_tests (pull_request) Successful in 3m58s
CI / integration_tests (pull_request) Successful in 4m34s
CI / docker (pull_request) Successful in 1m6s
CI / coverage (pull_request) Successful in 6m21s
CI / quality (push) Successful in 16s
CI / lint (push) Successful in 21s
CI / security (push) Successful in 32s
CI / typecheck (push) Successful in 35s
CI / benchmark-regression (push) Has been skipped
CI / build (push) Successful in 39s
CI / unit_tests (push) Successful in 2m38s
CI / integration_tests (push) Successful in 3m2s
CI / docker (push) Successful in 40s
CI / coverage (push) Successful in 4m9s
CI / benchmark-publish (push) Successful in 14m42s
CI / benchmark-regression (pull_request) Successful in 26m29s
Add LLMTrace Pydantic v2 domain model with all required fields (trace_id, plan_id, decision_id, actor, provider, model, prompt_tokens, completion_tokens, cost_usd, latency_ms, tool_calls, context_hash, streaming, retry_count, error). Define 14 OperationalMetricKey values (PLAN_DURATION_MS, PLAN_TOTAL_COST_USD, PLAN_DECISION_COUNT, ACTOR_INVOCATION_COUNT, ACTOR_LATENCY_MS, TOOL_INVOCATION_COUNT, TOOL_ERROR_RATE, CONTEXT_BUILD_TIME_MS, CONTEXT_TOKEN_COUNT, LLM_CALL_COUNT, LLM_TOTAL_TOKENS, LLM_TOTAL_COST_USD, LLM_AVG_LATENCY_MS, SUBPLAN_COUNT) with MetricEntry model and MetricCollector. Add llm_traces database table (LLMTraceModel) with LLMTraceRepository for persistence. TraceService provides recording, querying, metric computation, plan lifecycle hooks, and optional LangSmith forwarding when LANGCHAIN_TRACING_V2=true. Wired into DI container as trace_service. Includes 28 Behave BDD scenarios, 6 Robot Framework smoke tests, 3 ASV benchmark suites, and reference documentation. Fix pre-existing cli_core server_mode test flake by mocking resolve_server_mode in test steps to avoid stale config file interference. Closes #500
119 lines
6.0 KiB
Plaintext
119 lines
6.0 KiB
Plaintext
*** Settings ***
|
|
Documentation Integration tests for enhanced version, info, diagnostics commands
|
|
Resource ${CURDIR}/common.resource
|
|
Library Process
|
|
Library OperatingSystem
|
|
Library String
|
|
Library Collections
|
|
Suite Setup Setup Test Environment
|
|
Suite Teardown Cleanup Test Environment
|
|
|
|
*** Variables ***
|
|
${PYTHON} python
|
|
|
|
*** Keywords ***
|
|
Run CLI With Clean Home
|
|
[Documentation] Run a CLI command with a temp HOME to avoid stale config
|
|
[Arguments] @{cmd}
|
|
${tmpdir}= Evaluate __import__('tempfile').mkdtemp(prefix='cli_core_')
|
|
${result}= Run Process @{cmd} timeout=60s env:HOME=${tmpdir}
|
|
RETURN ${result}
|
|
|
|
*** Test Cases ***
|
|
Version Command Default Rich Format
|
|
[Documentation] Version command with default (rich) format shows version string
|
|
${result}= Run Process ${PYTHON} -m cleveragents version timeout=60s
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} 1.0.0
|
|
Should Contain ${result.stdout} CleverAgents
|
|
|
|
Version Command JSON Format
|
|
[Documentation] Version command with --format json returns valid JSON
|
|
${result}= Run Process ${PYTHON} -m cleveragents version --format json timeout=60s
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} "version": "1.0.0"
|
|
Should Contain ${result.stdout} "schema": "v3"
|
|
Should Contain ${result.stdout} "channel": "stable"
|
|
Should Contain ${result.stdout} "python"
|
|
Should Contain ${result.stdout} "dependencies"
|
|
Should Contain ${result.stdout} "build_date"
|
|
Should Contain ${result.stdout} "commit"
|
|
|
|
Version Command Plain Format
|
|
[Documentation] Version command with --format plain returns key-value pairs
|
|
${result}= Run Process ${PYTHON} -m cleveragents version --format plain timeout=60s
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} version: 1.0.0
|
|
Should Contain ${result.stdout} schema: v3
|
|
|
|
Version Command YAML Format
|
|
[Documentation] Version command with --format yaml returns YAML
|
|
${result}= Run Process ${PYTHON} -m cleveragents version --format yaml timeout=60s
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} version: 1.0.0
|
|
Should Contain ${result.stdout} schema: v3
|
|
|
|
Info Command Default Rich Format
|
|
[Documentation] Info command with default (rich) format shows environment details
|
|
${result}= Run Process ${PYTHON} -m cleveragents info timeout=60s
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} Environment
|
|
Should Contain ${result.stdout} Runtime
|
|
|
|
Info Command JSON Format
|
|
[Documentation] Info command with --format json returns structured data
|
|
${result}= Run CLI With Clean Home ${PYTHON} -m cleveragents info --format json
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} "version": "1.0.0"
|
|
Should Contain ${result.stdout} "data_dir"
|
|
Should Contain ${result.stdout} "database"
|
|
Should Contain ${result.stdout} "server_mode"
|
|
|
|
Info Command Plain Format
|
|
[Documentation] Info command with --format plain returns key-value pairs
|
|
${result}= Run CLI With Clean Home ${PYTHON} -m cleveragents info --format plain
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} version: 1.0.0
|
|
Should Contain ${result.stdout} server_mode:
|
|
|
|
Diagnostics Command Default Rich Format
|
|
[Documentation] Diagnostics command with default (rich) format runs checks
|
|
${result}= Run Process ${PYTHON} -m cleveragents diagnostics timeout=60s
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} Checks
|
|
Should Contain ${result.stdout} Summary
|
|
|
|
Diagnostics Command JSON Format
|
|
[Documentation] Diagnostics command with --format json returns structured data
|
|
${result}= Run Process ${PYTHON} -m cleveragents diagnostics --format json timeout=60s
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} "checks"
|
|
Should Contain ${result.stdout} "summary"
|
|
Should Contain ${result.stdout} "recommendations"
|
|
Should Contain ${result.stdout} "total"
|
|
Should Contain ${result.stdout} "warnings"
|
|
Should Contain ${result.stdout} "errors"
|
|
|
|
Diagnostics Command Plain Format
|
|
[Documentation] Diagnostics command with --format plain returns key-value pairs
|
|
${result}= Run Process ${PYTHON} -m cleveragents diagnostics --format plain timeout=60s
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} checks:
|
|
Should Contain ${result.stdout} summary:
|
|
|
|
Diagnostics Command Check Flag Returns Valid Exit Code
|
|
[Documentation] Diagnostics --check exits 0 (no errors) or 1 (has errors) without crashing
|
|
${result}= Run Process ${PYTHON} -m cleveragents diagnostics --check --format json timeout=60s
|
|
Should Be True ${result.rc} == 0 or ${result.rc} == 1 Unexpected exit code: ${result.rc}
|
|
Should Contain ${result.stdout} "checks"
|
|
Should Contain ${result.stdout} "has_errors"
|
|
|
|
Diagnostics Command Performance
|
|
[Documentation] Diagnostics command completes within acceptable time
|
|
${start}= Get Time epoch
|
|
${result}= Run Process ${PYTHON} -m cleveragents diagnostics --format json timeout=60s
|
|
${end}= Get Time epoch
|
|
${duration}= Evaluate ${end} - ${start}
|
|
Should Be True ${duration} < 30 Diagnostics took too long: ${duration}s
|
|
Should Be Equal As Integers ${result.rc} 0
|