Files
cleveragents-core/features/config_cli_scope_coverage.feature
T
freemo 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
test(coverage): add Behave scenarios for 39 under-covered modules
Add Behave feature/step pairs that exercise uncovered branches across handlers, LSP, CLI, and service layers to reach the coverage gate.

ISSUES CLOSED: #1232
2026-03-31 21:47:12 +00:00

63 lines
3.3 KiB
Gherkin

Feature: Config CLI scope coverage (cfcov3)
Supplementary scenarios targeting uncovered lines 224-229 and 252-259
in cleveragents/cli/commands/config.py the --scope flag handling
in the config_set command.
Background:
Given a cfcov3 isolated temp config directory
# ── Lines 224-229: invalid scope raises typer.BadParameter ──────────
Scenario: config set with invalid --scope raises BadParameter
When I invoke cfcov3 config set "plan.concurrency" "8" with scope "invalid"
Then the cfcov3 CLI result should have a non-zero exit code
And the cfcov3 CLI output should contain "Invalid scope"
# ── Lines 252-253, 258-259: --scope global branch ───────────────────
Scenario: config set with --scope global writes via set_value
When I invoke cfcov3 config set "plan.concurrency" "16" with scope "global"
Then the cfcov3 CLI result should have exit code 0
And the cfcov3 CLI output should contain "plan.concurrency"
And the cfcov3 CLI output should contain "global"
# ── Lines 254-255, 258-259: --scope project branch ─────────────────
Scenario: config set with --scope project writes via set_value
When I invoke cfcov3 config set "plan.concurrency" "12" with scope "project"
Then the cfcov3 CLI result should have exit code 0
And the cfcov3 CLI output should contain "plan.concurrency"
And the cfcov3 CLI output should contain "project"
# ── Lines 257-259: --scope local branch ─────────────────────────────
Scenario: config set with --scope local writes via set_value
When I invoke cfcov3 config set "plan.concurrency" "20" with scope "local"
Then the cfcov3 CLI result should have exit code 0
And the cfcov3 CLI output should contain "plan.concurrency"
And the cfcov3 CLI output should contain "local"
# ── Lines 252-253 with pre-existing global value ────────────────────
Scenario: config set --scope global shows previous value from config_data
Given the cfcov3 global config has "plan.concurrency" set to 4
When I invoke cfcov3 config set "plan.concurrency" "99" with scope "global"
Then the cfcov3 CLI result should have exit code 0
And the cfcov3 set_value mock should have been called with scope GLOBAL
# ── Lines 254-255 reading previous from project config ──────────────
Scenario: config set --scope project reads previous from project config
Given the cfcov3 project config returns "plan.concurrency" as 7
When I invoke cfcov3 config set "plan.concurrency" "14" with scope "project"
Then the cfcov3 CLI result should have exit code 0
And the cfcov3 read_project_config mock should have been called
# ── Lines 257-259 reading previous from local config ────────────────
Scenario: config set --scope local reads previous from local config
Given the cfcov3 local config returns "plan.concurrency" as 3
When I invoke cfcov3 config set "plan.concurrency" "30" with scope "local"
Then the cfcov3 CLI result should have exit code 0
And the cfcov3 read_local_config mock should have been called