Files
hurui200320 8953449dc2
CI / lint (pull_request) Successful in 30s
CI / typecheck (pull_request) Successful in 1m15s
CI / security (pull_request) Successful in 1m18s
CI / quality (pull_request) Successful in 30s
CI / build (pull_request) Successful in 37s
CI / helm (pull_request) Successful in 29s
CI / push-validation (pull_request) Successful in 26s
CI / e2e_tests (pull_request) Successful in 3m58s
CI / integration_tests (pull_request) Successful in 6m49s
CI / unit_tests (pull_request) Successful in 8m39s
CI / docker (pull_request) Successful in 1m23s
CI / coverage (pull_request) Successful in 13m32s
CI / benchmark-regression (push) Failing after 0s
CI / benchmark-publish (push) Failing after 0s
CI / status-check (pull_request) Successful in 1s
CI / lint (push) Successful in 25s
CI / typecheck (push) Successful in 1m1s
CI / quality (push) Successful in 55s
CI / security (push) Successful in 1m9s
CI / build (push) Successful in 24s
CI / helm (push) Successful in 30s
CI / push-validation (push) Successful in 20s
CI / e2e_tests (push) Successful in 5m13s
CI / integration_tests (push) Successful in 7m17s
CI / unit_tests (push) Successful in 8m50s
CI / docker (push) Successful in 1m30s
CI / coverage (push) Successful in 11m57s
CI / status-check (push) Successful in 2s
fix(actor): validate v3 YAML via ActorConfigSchema in agents actor add CLI
- schema.py: provider field changed to Optional[str] with model validator
  validate_provider_required_for_llm_graph() that requires it only for LLM
  and GRAPH actor types; TOOL actors do not require provider
- schema.py: is_v3_yaml() uses version_str == "3" or version_str.startswith("3.")
  to avoid false positives from "30" or "300" version strings
- schema.py: tool namespace validation uses strict 2-part split to reject
  empty namespace or empty name (e.g. "/tool", "ns/", "a/b/c")
- cli/commands/actor.py: schema_version extraction uses raw_version pattern
  (no # type: ignore[assignment]) for clean static typing
- actor/__init__.py: is_v3_yaml removed from __all__ and _LAZY_IMPORTS
  since it is a module-private helper, not a public API
- robot/actor_add_v3_schema_validation.robot: YAML fixtures for 'Reject v3
  LLM Actor Without Model Field' and 'Reject v3 TOOL Actor Without Tools
  Field' now include required provider field (and model for TOOL fixture)
- robot/helper_actor_add_v3_schema_validation.py: except clauses unified to
  catch (subprocess.TimeoutExpired, FileNotFoundError) in both add_actor()
  and update_actor() functions
- features/actor_add_v3_schema_validation.feature: 'Update a v3 actor with
  valid YAML succeeds' scenario now includes 'And the actor should be
  validated via ActorConfigSchema'; error assertions tightened to exact
  messages (e.g. "Input should be 'llm', 'tool' or 'graph'", "Node ID must
  be alphanumeric", "must be namespaced")
- features/steps/actor_add_v3_schema_validation_steps.py: step_run_actor_update
  now spies on ActorConfigSchema.model_validate; failure paths assert
  isinstance(result.exception, SystemExit)

ISSUES CLOSED: #5869
2026-04-17 16:28:45 +08:00

59 lines
3.0 KiB
Plaintext

*** Settings ***
Documentation Smoke tests for actor YAML loader and discovery
Resource ${CURDIR}/common.resource
Suite Setup Setup Test Environment
Suite Teardown Cleanup Test Environment
*** Variables ***
${HELPER} ${CURDIR}/helper_actor_loading.py
*** Test Cases ***
Discover Example Actors
[Documentation] Load all actors from examples/actors/ and verify count
${result}= Run Process ${PYTHON} ${HELPER} discover-examples cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} actor-count:
Discover Actors From Custom Directory
[Documentation] Discover actors from a temporary directory with a valid YAML
${tmp}= Set Variable ${TEMPDIR}${/}actor_loading_robot
Run Keyword And Ignore Error Remove Directory ${tmp} recursive=True
Create Directory ${tmp}
Create File ${tmp}${/}test.yaml name: local/robot-test\ntype: llm\ndescription: Robot test actor\nversion: "1.0"\nprovider: openai\nmodel: gpt-4\n
${result}= Run Process ${PYTHON} ${HELPER} discover ${tmp} cwd=${WORKSPACE}
Log ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} actor-loaded: local/robot-test
Should Contain ${result.stdout} actor-count: 1
Reject Invalid Actor YAML
[Documentation] Attempt to discover from a directory with invalid YAML and assert failure
${tmp}= Set Variable ${TEMPDIR}${/}actor_loading_invalid
Run Keyword And Ignore Error Remove Directory ${tmp} recursive=True
Create Directory ${tmp}
Create File ${tmp}${/}bad.yaml name: [\ninvalid yaml content\n
${result}= Run Process ${PYTHON} ${HELPER} discover-invalid ${tmp} cwd=${WORKSPACE}
Log ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} actor-loading-expected-fail
Default Namespace Applied
[Documentation] Verify that actors without namespace get local/ prefix
${result}= Run Process ${PYTHON} ${HELPER} namespace-default cwd=${WORKSPACE}
Log ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} namespace-default-ok: local/bare-name
Load Hierarchical Actor YAML Via Loader
[Documentation] Discover hierarchical_workflow.yaml via ActorLoader and verify graph properties
${result}= Run Process ${PYTHON} ${HELPER} discover-hierarchical cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} actor-loaded: workflows/dev-workflow
Should Contain ${result.stdout} actor-type: graph
Should Contain ${result.stdout} node-count: 3
Should Contain ${result.stdout} edge-count: 2