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
66 lines
3.2 KiB
Gherkin
66 lines
3.2 KiB
Gherkin
Feature: CLI main.py coverage round 3
|
|
As a developer
|
|
I want to cover remaining uncovered lines in cleveragents.cli.main
|
|
So that code coverage gaps on lines 104-110, 582-590, and 593-594 are closed
|
|
|
|
# -------------------------------------------------------------------
|
|
# Lines 104-110: _register_subcommands exception handler
|
|
# -------------------------------------------------------------------
|
|
|
|
Scenario: _register_subcommands handles import failure gracefully
|
|
Given cmcov3 the _subcommands_registered flag is reset to False
|
|
When cmcov3 _register_subcommands is called and an import raises an error
|
|
Then cmcov3 the error console should have printed the failure message
|
|
And cmcov3 the _subcommands_registered flag should still be False
|
|
|
|
# -------------------------------------------------------------------
|
|
# Lines 582-586: completion command with subprocess returning stdout
|
|
# -------------------------------------------------------------------
|
|
|
|
Scenario: completion command outputs subprocess stdout when present
|
|
Given cmcov3 subprocess.run is mocked to return stdout "echo hello"
|
|
When cmcov3 the completion command is invoked with shell "bash"
|
|
Then cmcov3 the output should contain "echo hello"
|
|
|
|
# -------------------------------------------------------------------
|
|
# Lines 587-590: completion command with empty subprocess stdout
|
|
# -------------------------------------------------------------------
|
|
|
|
Scenario: completion command outputs placeholder when subprocess has no stdout
|
|
Given cmcov3 subprocess.run is mocked to return empty stdout
|
|
When cmcov3 the completion command is invoked with shell "zsh"
|
|
Then cmcov3 the output should contain "# Completion script for zsh"
|
|
And cmcov3 the output should contain "# Shell: zsh"
|
|
|
|
# -------------------------------------------------------------------
|
|
# Lines 593-594+: convert_exit_code function coverage
|
|
# -------------------------------------------------------------------
|
|
|
|
Scenario: convert_exit_code returns 0 for None input
|
|
When cmcov3 convert_exit_code is called with None
|
|
Then cmcov3 the exit code result should be 0
|
|
|
|
Scenario: convert_exit_code extracts exit_code attribute from object
|
|
When cmcov3 convert_exit_code is called with an object having exit_code 42
|
|
Then cmcov3 the exit code result should be 42
|
|
|
|
Scenario: convert_exit_code clamps large positive code to 255
|
|
When cmcov3 convert_exit_code is called with integer 999
|
|
Then cmcov3 the exit code result should be 255
|
|
|
|
Scenario: convert_exit_code passes through negative codes
|
|
When cmcov3 convert_exit_code is called with integer -1
|
|
Then cmcov3 the exit code result should be -1
|
|
|
|
Scenario: convert_exit_code returns 1 for non-integer string
|
|
When cmcov3 convert_exit_code is called with a non-convertible value
|
|
Then cmcov3 the exit code result should be 1
|
|
|
|
Scenario: convert_exit_code handles zero correctly
|
|
When cmcov3 convert_exit_code is called with integer 0
|
|
Then cmcov3 the exit code result should be 0
|
|
|
|
Scenario: convert_exit_code handles normal positive code
|
|
When cmcov3 convert_exit_code is called with integer 7
|
|
Then cmcov3 the exit code result should be 7
|