test(coverage): add Behave BDD tests to improve unit test coverage across 53 source modules
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 17s
CI / typecheck (pull_request) Successful in 35s
CI / security (pull_request) Successful in 50s
CI / unit_tests (pull_request) Successful in 2m46s
CI / integration_tests (pull_request) Successful in 3m16s
CI / docker (pull_request) Successful in 40s
CI / coverage (pull_request) Successful in 5m6s
CI / lint (push) Successful in 13s
CI / quality (push) Successful in 16s
CI / build (push) Successful in 18s
CI / security (push) Successful in 32s
CI / typecheck (push) Successful in 35s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m52s
CI / integration_tests (push) Successful in 3m8s
CI / docker (push) Successful in 39s
CI / coverage (push) Successful in 5m53s
CI / benchmark-publish (push) Successful in 16m55s
CI / benchmark-regression (pull_request) Successful in 33m0s
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 17s
CI / typecheck (pull_request) Successful in 35s
CI / security (pull_request) Successful in 50s
CI / unit_tests (pull_request) Successful in 2m46s
CI / integration_tests (pull_request) Successful in 3m16s
CI / docker (pull_request) Successful in 40s
CI / coverage (pull_request) Successful in 5m6s
CI / lint (push) Successful in 13s
CI / quality (push) Successful in 16s
CI / build (push) Successful in 18s
CI / security (push) Successful in 32s
CI / typecheck (push) Successful in 35s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m52s
CI / integration_tests (push) Successful in 3m8s
CI / docker (push) Successful in 39s
CI / coverage (push) Successful in 5m53s
CI / benchmark-publish (push) Successful in 16m55s
CI / benchmark-regression (pull_request) Successful in 33m0s
Add 53 new .feature files and corresponding step definition files targeting uncovered lines identified in build/coverage.xml. Fix AmbiguousStep conflicts in 7 pre-existing step files by disambiguating step text. New tests cover: ACP clients/facade, actor CLI/config, application container, ACMS service/strategies, async worker, automation profile CLI, autonomy guardrail, bridge, change model, config CLI/service, context service, cross-plan correction, database models, decision service, decomposition clustering/service, discovery handler, langchain chat provider, langgraph nodes, materializers, multi-project service, plan apply/CLI/lifecycle/model/ preflight/resume/service, PostgreSQL analyzer, project CLI/context CLI, provider registry, reactive application/route, repositories, resolver handler, resource registry service, resume model, retry patterns, sandbox protocol, server CLI, skill CLI/service, skills registry, subplan execution/service, system CLI, UKO loader, UoW, and YAML template engine. Closes #645
This commit was merged in pull request #646.
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
Feature: Skill CLI coverage boost
|
||||
Target remaining uncovered lines in src/cleveragents/cli/commands/skill.py:
|
||||
- Lines 82-103: _get_skill_service DB initialization and fallback
|
||||
- Line 889: tools non-rich format source_type "agent_skills" branch
|
||||
- Lines 984-985: refresh defensive guard for name=None after earlier check
|
||||
|
||||
Background:
|
||||
Given boost- a fresh skill CLI service
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# _get_skill_service: DB initialization path (lines 82-100)
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
Scenario: _get_skill_service creates service with DB when container is available
|
||||
Given boost- the module-level _service is set to None
|
||||
And boost- the DI container and DB components are mocked successfully
|
||||
When boost- I call _get_skill_service
|
||||
Then boost- the returned service should have a skill_repo
|
||||
And boost- create_engine should have been called with the mock database URL
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# _get_skill_service: exception fallback (lines 101-103)
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
Scenario: _get_skill_service falls back to in-memory when DB setup fails
|
||||
Given boost- the module-level _service is set to None
|
||||
And boost- the DI container import will raise an exception
|
||||
When boost- I call _get_skill_service
|
||||
Then boost- the returned service should be an in-memory SkillService
|
||||
And boost- the returned service should have no skill_repo
|
||||
|
||||
Scenario: _get_skill_service falls back when create_engine raises
|
||||
Given boost- the module-level _service is set to None
|
||||
And boost- create_engine will raise an OperationalError
|
||||
When boost- I call _get_skill_service
|
||||
Then boost- the returned service should be an in-memory SkillService
|
||||
And boost- the returned service should have no skill_repo
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# tools non-rich format: agent_skill: source type (line 889)
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
Scenario: Tools JSON output shows agent_skills source for agent_skill entries
|
||||
Given boost- a registered skill "local/agent-skill-test" with agent_skills
|
||||
When boost- I invoke tools "local/agent-skill-test" in format "json"
|
||||
Then boost- the CLI exit code should be 0
|
||||
And boost- the JSON output should be valid
|
||||
And boost- the JSON tools list should contain an entry with source "agent_skills"
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# refresh: defensive name=None guard (lines 984-985)
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
Scenario: Refresh defensive guard fires when name is None after bypassing first check
|
||||
Given boost- a fresh skill CLI service
|
||||
When boost- I call refresh directly with name None and all_skills False bypassing first guard
|
||||
Then boost- the second guard should have printed the error message
|
||||
And boost- the function should have raised Abort
|
||||
Reference in New Issue
Block a user