Files
cleveragents-core/features/actor_registry_new_coverage.feature
T
brent.edwards e801eb1ee8 feat(ci): add nox-based PR validation workflow
- Rewrite .forgejo/workflows/ci.yml to route all jobs through nox sessions
- Fix coverage_report nox session: serial behave mode replaces broken parallel
  mode (22% -> 97% accuracy), raise fail-under from 85% to 97%
- Pass posargs through format nox session for CI --check support
- Add 11 CI workflow validation scenarios (Behave) + Robot smoke test + ASV bench
- Add 108 new Behave scenarios covering 6 largest coverage gaps to reach 97%:
  yaml_template_engine, actor/config, actor/registry, message_router,
  context_analysis, context_service
- Update docs/development/ci-cd.md with nox-based CI docs and 97% threshold
- Restore implementation_plan.md verbose style, check off completed CI tasks

Verified: 1673 scenarios pass, 97% coverage, lint clean, typecheck clean
2026-02-12 22:01:51 +00:00

77 lines
3.3 KiB
Gherkin

Feature: Actor registry new coverage
As a developer
I want ActorRegistry thoroughly tested
So that built-in actor generation and custom upsert stay stable
Scenario: Registry initializes with service, provider registry, and settings
Given a stubbed actor registry
Then the registry should have an actor service
And the registry should have a provider registry
And the registry should have settings
Scenario: _actor_name formats provider/model pair
Given a stubbed actor registry
When I format actor name for provider "openai" and model "gpt-4"
Then the actor name should be "openai/gpt-4"
Scenario: _build_graph_descriptor returns expected structure
Given a stubbed actor registry
When I build a graph descriptor for provider "openai" model "gpt-4" source "test"
Then the descriptor should contain provider model and source
Scenario: _canonical_blob fills defaults from config
Given a stubbed actor registry
When I build a canonical blob from a config and raw blob
Then the blob should contain provider model and source keys
Scenario: ensure_built_in_actors returns empty when no providers configured
Given a stubbed actor registry with no configured providers
When I ensure built-in actors
Then the registry result should be an empty list
Scenario: ensure_built_in_actors creates actors for configured providers
Given a stubbed actor registry with configured providers
When I ensure built-in actors
Then the result should contain created actors
And the default actor should be set
Scenario: ensure_built_in_actors uses preferred provider when defaults match
Given a stubbed actor registry with configured providers and provider defaults
When I ensure built-in actors
Then the preferred provider should be set as default
Scenario: upsert_actor parses and persists a custom actor
Given a stubbed actor registry with configured providers
When I upsert a custom actor with name "local/test" and valid config
Then the actor should be persisted via the service
Scenario: upsert_actor raises ValidationError for unsafe config without flag
Given a stubbed actor registry with configured providers
When I upsert an actor with unsafe config but no unsafe flag
Then a ValidationError should be raised
Scenario: get_actor delegates to actor service
Given a stubbed actor registry with configured providers
When I get actor "local/test"
Then the actor service get_actor should be called
Scenario: list_actors delegates to actor service
Given a stubbed actor registry with configured providers
When I list actors
Then the actor service list_actors should be called
Scenario: remove_actor delegates to actor service
Given a stubbed actor registry with configured providers
When I remove actor "local/test"
Then the actor service remove_actor should be called
Scenario: set_default_actor delegates to actor service
Given a stubbed actor registry with configured providers
When I set default actor "local/test"
Then the actor service set_default_actor should be called
Scenario: get_default_actor delegates to actor service
Given a stubbed actor registry with configured providers
When I get default actor
Then the actor service get_default_actor should be called