TEST-INFRA: [coverage-gaps] Zero coverage for src/cleveragents/config/__main__.py #2271

Open
opened 2026-04-03 12:24:37 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: test/config-main-coverage
  • Commit Message: test(config): add BDD scenarios for config __main__ security scanner CLI entry point
  • Milestone: v3.8.0
  • Parent Epic: #1678

Background and Context

The file src/cleveragents/config/__main__.py currently has 0% test coverage. This file serves as the python -m cleveragents.config entry point, which invokes the security scanner CLI via cleveragents.config.security_scanner._cli_main(). As a module entry point, it is a critical integration boundary between the Python module system and the security scanner CLI — any regression here would silently break the python -m cleveragents.config invocation path.

Per the project's coverage threshold requirement (≥ 97%), all source files must be covered by tests. A file at 0% coverage is a critical gap that must be addressed.

Current Behavior

Running the coverage report shows src/cleveragents/config/__main__.py at 0% coverage. No BDD scenarios exist that exercise the python -m cleveragents.config entry point or the SystemExit delegation to _cli_main().

Expected Behavior

BDD scenarios exist that cover the __main__.py entry point, verifying:

  • That python -m cleveragents.config correctly delegates to cleveragents.config.security_scanner._cli_main()
  • That the SystemExit is raised with the return value of _cli_main()
  • Edge cases such as _cli_main() returning a non-zero exit code

Acceptance Criteria

  • At least one Gherkin feature file covers the config/__main__.py entry point behaviour
  • All new scenarios are implemented with full step definitions (no placeholder steps)
  • Coverage for src/cleveragents/config/__main__.py reaches 100%
  • Overall project coverage remains ≥ 97%
  • All nox default sessions pass without errors

Supporting Information

  • File contents of src/cleveragents/config/__main__.py:
    """Allow ``python -m cleveragents.config`` to invoke the security scanner CLI."""
    
    from __future__ import annotations
    
    from cleveragents.config.security_scanner import _cli_main
    
    raise SystemExit(_cli_main())
    
  • Related Epic: #1678 (CI Execution Time Optimization — Timeouts, Concurrency, and Coverage Artifact Sharing)
  • Per CONTRIBUTING.md: BDD (Behave/Gherkin) is the required testing approach for unit-level scenarios

Subtasks

  • Identify or create the appropriate Behave feature file for config/__main__ entry point behaviour
  • Write Gherkin scenarios covering: successful delegation to _cli_main(), SystemExit propagation, and non-zero exit code handling
  • Implement all step definitions for the new scenarios (no placeholder steps)
  • Verify src/cleveragents/config/__main__.py reaches 100% coverage via nox -s coverage_report
  • Verify overall project coverage remains ≥ 97%
  • Run nox (all default sessions) and fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly (test(config): add BDD scenarios for config __main__ security scanner CLI entry point), followed by a blank line, then additional lines providing relevant implementation details.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly (test/config-main-coverage).
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage ≥ 97%.

Automated by CleverAgents Bot
Supervisor: Test Infrastructure | Agent: ca-new-issue-creator

## Metadata - **Branch**: `test/config-main-coverage` - **Commit Message**: `test(config): add BDD scenarios for config __main__ security scanner CLI entry point` - **Milestone**: v3.8.0 - **Parent Epic**: #1678 ## Background and Context The file `src/cleveragents/config/__main__.py` currently has **0% test coverage**. This file serves as the `python -m cleveragents.config` entry point, which invokes the security scanner CLI via `cleveragents.config.security_scanner._cli_main()`. As a module entry point, it is a critical integration boundary between the Python module system and the security scanner CLI — any regression here would silently break the `python -m cleveragents.config` invocation path. Per the project's coverage threshold requirement (≥ 97%), all source files must be covered by tests. A file at 0% coverage is a critical gap that must be addressed. ## Current Behavior Running the coverage report shows `src/cleveragents/config/__main__.py` at 0% coverage. No BDD scenarios exist that exercise the `python -m cleveragents.config` entry point or the `SystemExit` delegation to `_cli_main()`. ## Expected Behavior BDD scenarios exist that cover the `__main__.py` entry point, verifying: - That `python -m cleveragents.config` correctly delegates to `cleveragents.config.security_scanner._cli_main()` - That the `SystemExit` is raised with the return value of `_cli_main()` - Edge cases such as `_cli_main()` returning a non-zero exit code ## Acceptance Criteria - [ ] At least one Gherkin feature file covers the `config/__main__.py` entry point behaviour - [ ] All new scenarios are implemented with full step definitions (no placeholder steps) - [ ] Coverage for `src/cleveragents/config/__main__.py` reaches 100% - [ ] Overall project coverage remains ≥ 97% - [ ] All `nox` default sessions pass without errors ## Supporting Information - File contents of `src/cleveragents/config/__main__.py`: ```python """Allow ``python -m cleveragents.config`` to invoke the security scanner CLI.""" from __future__ import annotations from cleveragents.config.security_scanner import _cli_main raise SystemExit(_cli_main()) ``` - Related Epic: #1678 (CI Execution Time Optimization — Timeouts, Concurrency, and Coverage Artifact Sharing) - Per CONTRIBUTING.md: BDD (Behave/Gherkin) is the required testing approach for unit-level scenarios ## Subtasks - [ ] Identify or create the appropriate Behave feature file for `config/__main__` entry point behaviour - [ ] Write Gherkin scenarios covering: successful delegation to `_cli_main()`, `SystemExit` propagation, and non-zero exit code handling - [ ] Implement all step definitions for the new scenarios (no placeholder steps) - [ ] Verify `src/cleveragents/config/__main__.py` reaches 100% coverage via `nox -s coverage_report` - [ ] Verify overall project coverage remains ≥ 97% - [ ] Run `nox` (all default sessions) and fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly (`test(config): add BDD scenarios for config __main__ security scanner CLI entry point`), followed by a blank line, then additional lines providing relevant implementation details. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly (`test/config-main-coverage`). - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage ≥ 97%. --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: ca-new-issue-creator
freemo added this to the v3.8.0 milestone 2026-04-03 12:25:08 +00:00
Author
Owner

Duplicate of #1989.

This issue describes the same coverage gap as #1989 ("Add test coverage for src/cleveragents/config/main.py", v3.8.0). Both report 0% coverage for the same file and request BDD scenarios for the entry point. #1989 was triaged in cycle 1 with MoSCoW: Could Have.

Closing as a duplicate.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

**Duplicate of #1989.** This issue describes the same coverage gap as #1989 ("Add test coverage for src/cleveragents/config/__main__.py", v3.8.0). Both report 0% coverage for the same file and request BDD scenarios for the entry point. #1989 was triaged in cycle 1 with MoSCoW: Could Have. Closing as a duplicate. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
freemo reopened this issue 2026-04-03 12:31:40 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#2271
No description provided.