TEST-INFRA: [coverage-gaps] Improve test coverage for src/cleveragents/__main__.py #1790

Open
opened 2026-04-02 23:50:54 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: test/main-module-full-coverage
  • Commit Message: test(main): add Behave, Robot, and ASV tests for __main__.py CLI entry point
  • Milestone: v3.2.0
  • Parent Epic: #1678

Background and Context

The test coverage for src/cleveragents/__main__.py is 0.00%. This is a critical gap that needs to be addressed to ensure the reliability of the CLI entry point. The __main__.py module is the primary entry point for the agents CLI and must be covered at all three test levels (unit, integration, and performance) per the project's multi-level testing mandate.

Note: A related issue #1754 exists that covers only Behave unit tests for this module. This issue extends that scope to include Robot Framework integration tests and ASV performance benchmarks, fulfilling the full multi-level testing mandate from CONTRIBUTING.md.

Expected Behavior

  • src/cleveragents/__main__.py has ≥ 97% test coverage.
  • All code paths in the CLI entry point are exercised at the unit, integration, and performance levels.
  • All new tests pass in the CI pipeline.

Acceptance Criteria

  • Behave unit test scenarios cover all code paths in src/cleveragents/__main__.py (including normal invocation, error paths, and edge cases).
  • Robot Framework integration tests exercise the CLI entry point end-to-end.
  • ASV performance benchmarks exist for the CLI entry point startup path.
  • nox -e coverage_report reports ≥ 97% coverage for src/cleveragents/__main__.py.
  • All nox stages pass (nox).

Subtasks

  • Audit src/cleveragents/__main__.py to identify all untested code paths and branches.
  • Write Behave feature file(s) in features/ covering all scenarios in __main__.py.
  • Implement step definitions for each Behave scenario; place any required mocks/test doubles in features/mocks/.
  • Write Robot Framework integration tests for the CLI entry point.
  • Write ASV performance benchmarks for the CLI entry point startup path.
  • Run nox -e unit_tests and confirm all new Behave scenarios pass.
  • Run nox -e integration_tests and confirm all new Robot tests pass.
  • Run nox -e benchmarks and confirm ASV benchmarks run without error.
  • Run nox -e coverage_report and confirm coverage for src/cleveragents/__main__.py is ≥ 97%.
  • Run nox -e typecheck and confirm no type errors are introduced.
  • Run nox -e lint and confirm no linting violations.
  • Run full nox and confirm all stages pass.

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(main): add Behave, Robot, and ASV tests for __main__.py CLI entry point), followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly (test/main-module-full-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/main-module-full-coverage` - **Commit Message**: `test(main): add Behave, Robot, and ASV tests for __main__.py CLI entry point` - **Milestone**: v3.2.0 - **Parent Epic**: #1678 ## Background and Context The test coverage for `src/cleveragents/__main__.py` is 0.00%. This is a critical gap that needs to be addressed to ensure the reliability of the CLI entry point. The `__main__.py` module is the primary entry point for the `agents` CLI and must be covered at all three test levels (unit, integration, and performance) per the project's multi-level testing mandate. > **Note:** A related issue #1754 exists that covers only Behave unit tests for this module. This issue extends that scope to include Robot Framework integration tests and ASV performance benchmarks, fulfilling the full multi-level testing mandate from CONTRIBUTING.md. ## Expected Behavior - `src/cleveragents/__main__.py` has ≥ 97% test coverage. - All code paths in the CLI entry point are exercised at the unit, integration, and performance levels. - All new tests pass in the CI pipeline. ## Acceptance Criteria - [ ] Behave unit test scenarios cover all code paths in `src/cleveragents/__main__.py` (including normal invocation, error paths, and edge cases). - [ ] Robot Framework integration tests exercise the CLI entry point end-to-end. - [ ] ASV performance benchmarks exist for the CLI entry point startup path. - [ ] `nox -e coverage_report` reports ≥ 97% coverage for `src/cleveragents/__main__.py`. - [ ] All nox stages pass (`nox`). ## Subtasks - [ ] Audit `src/cleveragents/__main__.py` to identify all untested code paths and branches. - [ ] Write Behave feature file(s) in `features/` covering all scenarios in `__main__.py`. - [ ] Implement step definitions for each Behave scenario; place any required mocks/test doubles in `features/mocks/`. - [ ] Write Robot Framework integration tests for the CLI entry point. - [ ] Write ASV performance benchmarks for the CLI entry point startup path. - [ ] Run `nox -e unit_tests` and confirm all new Behave scenarios pass. - [ ] Run `nox -e integration_tests` and confirm all new Robot tests pass. - [ ] Run `nox -e benchmarks` and confirm ASV benchmarks run without error. - [ ] Run `nox -e coverage_report` and confirm coverage for `src/cleveragents/__main__.py` is ≥ 97%. - [ ] Run `nox -e typecheck` and confirm no type errors are introduced. - [ ] Run `nox -e lint` and confirm no linting violations. - [ ] Run full `nox` and confirm all stages pass. ## 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(main): add Behave, Robot, and ASV tests for __main__.py CLI entry point`), followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly (`test/main-module-full-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.2.0 milestone 2026-04-02 23:51:07 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: High — 0% test coverage on the CLI entry point is a significant gap. The __main__.py module is the primary user-facing entry point and must be covered.
  • Milestone: v3.2.0 — Keeping in v3.2.0 as test coverage ≥97% is an acceptance criterion for this milestone.
  • MoSCoW: Must Have — The project mandates ≥97% test coverage at all times. A 0% coverage gap on a core module directly violates this requirement and blocks milestone completion.
  • Parent Epic: #1678 (CI Execution Time Optimization) — This issue references #1678 as its parent Epic.

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

Issue triaged by project owner: - **State**: Verified - **Priority**: High — 0% test coverage on the CLI entry point is a significant gap. The `__main__.py` module is the primary user-facing entry point and must be covered. - **Milestone**: v3.2.0 — Keeping in v3.2.0 as test coverage ≥97% is an acceptance criterion for this milestone. - **MoSCoW**: Must Have — The project mandates ≥97% test coverage at all times. A 0% coverage gap on a core module directly violates this requirement and blocks milestone completion. - **Parent Epic**: #1678 (CI Execution Time Optimization) — This issue references #1678 as its parent Epic. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
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#1790
No description provided.