forked from cleveragents/cleveragents-core
a808c395f9
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
52 lines
2.5 KiB
Gherkin
52 lines
2.5 KiB
Gherkin
Feature: Devcontainer discovery handler - uncovered code paths
|
|
As a developer maintaining CleverAgents
|
|
I want full test coverage for the devcontainer discovery module
|
|
So that edge cases and error paths are exercised
|
|
|
|
Background:
|
|
Given the devcontainer discovery module is imported
|
|
|
|
# ── DevcontainerDiscoveryResult validation (lines 57-58) ───
|
|
|
|
Scenario: Reject non-Path config_path in DevcontainerDiscoveryResult
|
|
When I create a DevcontainerDiscoveryResult with a string config_path
|
|
Then a discovery TypeError should be raised with message containing "config_path must be a Path"
|
|
|
|
# ── DevcontainerDiscoveryResult validation (lines 61-62) ───
|
|
|
|
Scenario: Reject non-dict config_data in DevcontainerDiscoveryResult
|
|
When I create a DevcontainerDiscoveryResult with a list config_data
|
|
Then a discovery TypeError should be raised with message containing "config_data must be a dict"
|
|
|
|
# ── discover_devcontainers empty resource_location (line 94) ───
|
|
|
|
Scenario: Raise ValueError for empty resource_location
|
|
When I call discover_devcontainers with an empty resource_location
|
|
Then a discovery ValueError should be raised with message containing "resource_location must not be empty"
|
|
|
|
# ── discover_devcontainers empty resource_type (line 96) ────
|
|
|
|
Scenario: Raise ValueError for empty resource_type
|
|
When I call discover_devcontainers with an empty resource_type
|
|
Then a discovery ValueError should be raised with message containing "resource_type must not be empty"
|
|
|
|
# ── discover_devcontainers non-directory location (lines 103-107) ──
|
|
|
|
Scenario: Return empty list when resource location is not a directory
|
|
Given a temporary file that is not a directory
|
|
When I call discover_devcontainers with that file path as location and type "git-checkout"
|
|
Then the discovery result list should be empty
|
|
|
|
# ── is_trigger_type empty resource_type (line 140) ──────────
|
|
|
|
Scenario: Raise ValueError for empty resource_type in is_trigger_type
|
|
When I call is_trigger_type with an empty string
|
|
Then a discovery ValueError should be raised with message containing "resource_type must not be empty"
|
|
|
|
# ── _load_devcontainer_json OSError handling (lines 155-157) ──
|
|
|
|
Scenario: Return empty results when devcontainer.json is unreadable
|
|
Given a temporary directory with an unreadable devcontainer.json
|
|
When I call discover_devcontainers on that directory as "git-checkout"
|
|
Then the discovery result list should be empty
|