31472b5413
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 21s
CI / helm (pull_request) Successful in 22s
CI / lint (pull_request) Successful in 3m20s
CI / quality (pull_request) Successful in 3m43s
CI / typecheck (pull_request) Successful in 3m58s
CI / security (pull_request) Successful in 4m8s
CI / integration_tests (pull_request) Successful in 9m33s
CI / unit_tests (pull_request) Successful in 10m12s
CI / docker (pull_request) Successful in 1m28s
CI / coverage (pull_request) Successful in 12m18s
CI / e2e_tests (pull_request) Successful in 19m51s
CI / status-check (pull_request) Successful in 1s
CI / build (push) Successful in 15s
CI / helm (push) Successful in 22s
CI / lint (push) Successful in 3m18s
CI / quality (push) Successful in 3m41s
CI / typecheck (push) Successful in 3m57s
CI / benchmark-regression (push) Has been skipped
CI / security (push) Successful in 4m10s
CI / unit_tests (push) Failing after 6m58s
CI / docker (push) Has been skipped
CI / integration_tests (push) Successful in 9m15s
CI / coverage (push) Successful in 12m26s
CI / e2e_tests (push) Successful in 23m11s
CI / status-check (push) Failing after 1s
CI / benchmark-publish (push) Successful in 28m31s
CI / benchmark-regression (pull_request) Successful in 54m53s
Add Behave feature/step pairs that exercise uncovered branches across handlers, LSP, CLI, and service layers to reach the coverage gate. ISSUES CLOSED: #1232
65 lines
3.6 KiB
Gherkin
65 lines
3.6 KiB
Gherkin
Feature: Project context coverage round 3 (pccov3)
|
|
Additional Behave scenarios targeting specific uncovered lines in
|
|
src/cleveragents/cli/commands/project_context.py.
|
|
|
|
Covered lines:
|
|
- 156: _read_policy returns fresh default when _load_policy_json is None
|
|
- 175: _read_acms_config returns defaults when _load_policy_json is None
|
|
- 350: _simulate_context_assembly truncates fragment content >100 chars
|
|
- 674-675, 678: context_set rejects negative depth-gradient hop
|
|
- 864-869: context_show rich output displays execution environment info
|
|
|
|
Background:
|
|
Given a pccov3 in-memory database is initialized
|
|
And a project "local/pccov3-app" exists for pccov3
|
|
|
|
# --- Line 156: _read_policy returns ProjectContextPolicy() when raw is None ---
|
|
Scenario: _read_policy returns fresh default when no policy blob exists
|
|
When I pccov3 read the policy for "local/pccov3-app"
|
|
Then the pccov3 policy should be a default ProjectContextPolicy
|
|
And the pccov3 policy strategize_view should be None
|
|
And the pccov3 policy execute_view should be None
|
|
And the pccov3 policy apply_view should be None
|
|
|
|
# --- Line 175: _read_acms_config returns _default_acms_config() when raw is None ---
|
|
Scenario: _read_acms_config returns default config when no policy blob exists
|
|
When I pccov3 read the ACMS config for "local/pccov3-app"
|
|
Then the pccov3 ACMS config should equal the default ACMS config
|
|
|
|
# --- Line 350: content truncation in _simulate_context_assembly ---
|
|
Scenario: Simulate truncates fragment content longer than 100 characters
|
|
Given the pccov3 tier service has a fragment with long content for "local/pccov3-app"
|
|
When I pccov3 run simulate_context_assembly for "local/pccov3-app"
|
|
Then the pccov3 assembled fragments should have truncated content ending with "..."
|
|
|
|
# --- Lines 674-675, 678: negative depth-gradient hop ---
|
|
Scenario: Context set rejects negative depth-gradient hop value
|
|
When I pccov3 run context set on "local/pccov3-app" with depth-gradient "-1:5"
|
|
Then the pccov3 command should have exit code 1
|
|
And the pccov3 output should contain "hop must be a non-negative integer"
|
|
|
|
# --- Lines 864-869: execution environment info in context_show rich output ---
|
|
Scenario: Context show rich output displays execution environment and priority
|
|
Given I pccov3 seed execution environment "container" and priority "override" for "local/pccov3-app"
|
|
When I pccov3 run context show on "local/pccov3-app" without view
|
|
Then the pccov3 command should succeed
|
|
And the pccov3 output should contain "Execution Environment"
|
|
And the pccov3 output should contain "container"
|
|
And the pccov3 output should contain "override"
|
|
|
|
# --- Lines 864-869: only ee set, no priority ---
|
|
Scenario: Context show rich output displays execution environment without priority
|
|
Given I pccov3 seed execution environment "host" without priority for "local/pccov3-app"
|
|
When I pccov3 run context show on "local/pccov3-app" without view
|
|
Then the pccov3 command should succeed
|
|
And the pccov3 output should contain "Execution Environment"
|
|
And the pccov3 output should contain "host"
|
|
|
|
# --- Lines 864-869: only eep set, no ee ---
|
|
Scenario: Context show rich output displays priority without execution environment
|
|
Given I pccov3 seed priority "fallback" without execution environment for "local/pccov3-app"
|
|
When I pccov3 run context show on "local/pccov3-app" without view
|
|
Then the pccov3 command should succeed
|
|
And the pccov3 output should contain "Execution Environment"
|
|
And the pccov3 output should contain "fallback"
|