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,111 @@
|
||||
@phase1 @domain @skill_service_coverage
|
||||
Feature: SkillService uncovered code paths
|
||||
As a developer maintaining the SkillService
|
||||
I want comprehensive test coverage for defensive guards, exception
|
||||
handling in database persistence, and the update-persist path
|
||||
So that edge cases and failure modes are verified
|
||||
|
||||
# ────────────────────────────────────────────────────────
|
||||
# add_skill: None config guard (line 95)
|
||||
# ────────────────────────────────────────────────────────
|
||||
|
||||
@ssc_none_config
|
||||
Scenario: add_skill raises ValueError when config is None
|
||||
Given a skill service without persistence
|
||||
When I call add_skill with a None config
|
||||
Then a ssc ValueError should be raised with message "config cannot be None"
|
||||
|
||||
# ────────────────────────────────────────────────────────
|
||||
# _load_from_db: early return when repo is None (line 278)
|
||||
# ────────────────────────────────────────────────────────
|
||||
|
||||
@ssc_load_no_repo
|
||||
Scenario: _load_from_db returns immediately when no repo is set
|
||||
Given a skill service without persistence
|
||||
When I explicitly call _load_from_db
|
||||
Then the skills cache should remain empty
|
||||
And no ssc error should be raised
|
||||
|
||||
# ────────────────────────────────────────────────────────
|
||||
# _load_from_db: exception handling (lines 287-288)
|
||||
# ────────────────────────────────────────────────────────
|
||||
|
||||
@ssc_load_db_error
|
||||
Scenario: _load_from_db logs warning when list_all raises an exception
|
||||
Given a mock skill repo that raises on list_all
|
||||
When I create a skill service with the failing repo
|
||||
Then the skills cache should remain empty
|
||||
And a warning about failed database load should be logged
|
||||
|
||||
# ────────────────────────────────────────────────────────
|
||||
# _persist_skill: update path (line 298)
|
||||
# ────────────────────────────────────────────────────────
|
||||
|
||||
@ssc_persist_update
|
||||
Scenario: Updating an existing skill calls repo.update instead of repo.create
|
||||
Given a skill service with a mock repo and session factory
|
||||
And I add a skill "local/update-target" via config
|
||||
When I update the skill "local/update-target" via add_skill with update flag
|
||||
Then the mock repo update method should have been called
|
||||
And the mock repo create method should have been called once
|
||||
|
||||
# ────────────────────────────────────────────────────────
|
||||
# _persist_skill: exception handling on create (lines 300-304)
|
||||
# ────────────────────────────────────────────────────────
|
||||
|
||||
@ssc_persist_create_error
|
||||
Scenario: _persist_skill logs warning when repo.create raises
|
||||
Given a mock skill repo that raises on create
|
||||
And a skill service with the failing-create repo
|
||||
When I add a skill "local/fail-persist" via config ignoring persist errors
|
||||
Then the skill should still be in the in-memory cache
|
||||
And a warning about failed persist should be logged
|
||||
|
||||
# ────────────────────────────────────────────────────────
|
||||
# _persist_skill: exception handling on update (lines 300-304)
|
||||
# ────────────────────────────────────────────────────────
|
||||
|
||||
@ssc_persist_update_error
|
||||
Scenario: _persist_skill logs warning when repo.update raises
|
||||
Given a mock skill repo that raises on update
|
||||
And a skill service with the failing-update repo
|
||||
And I add a new skill "local/upd-fail" to the service
|
||||
When I update skill "local/upd-fail" with update flag ignoring persist errors
|
||||
Then the updated skill should be in the in-memory cache
|
||||
And a warning about failed persist on update should be logged
|
||||
|
||||
# ────────────────────────────────────────────────────────
|
||||
# _delete_skill_from_db: exception handling (lines 314-318)
|
||||
# ────────────────────────────────────────────────────────
|
||||
|
||||
@ssc_delete_db_error
|
||||
Scenario: _delete_skill_from_db logs warning when repo.delete raises
|
||||
Given a mock skill repo that raises on delete
|
||||
And a skill service with the failing-delete repo
|
||||
And I add a skill "local/del-fail" to the failing-delete service
|
||||
When I remove skill "local/del-fail" from the service
|
||||
Then the skill should be removed from the in-memory cache
|
||||
And a warning about failed database delete should be logged
|
||||
|
||||
# ────────────────────────────────────────────────────────
|
||||
# _commit: early return when no session_factory (line 324)
|
||||
# ────────────────────────────────────────────────────────
|
||||
|
||||
@ssc_commit_no_session
|
||||
Scenario: _commit returns early when session_factory is None
|
||||
Given a skill service with a mock repo but no session factory
|
||||
When I add a skill "local/no-session" via config on the no-session service
|
||||
Then the skill should be in the no-session service cache
|
||||
And no ssc error should be raised
|
||||
|
||||
# ────────────────────────────────────────────────────────
|
||||
# _commit: exception handling (lines 328-329)
|
||||
# ────────────────────────────────────────────────────────
|
||||
|
||||
@ssc_commit_error
|
||||
Scenario: _commit logs warning when session.commit raises
|
||||
Given a mock session factory that raises on commit
|
||||
And a skill service with a mock repo and the failing session factory
|
||||
When I add a skill "local/commit-fail" via config on the failing-commit service
|
||||
Then the skill should be in the failing-commit service cache
|
||||
And a warning about failed session commit should be logged
|
||||
Reference in New Issue
Block a user