Improve BDD unit test coverage for 8 under-covered modules #475

Closed
opened 2026-02-28 19:38:43 +00:00 by freemo · 1 comment
Owner

Metadata

  • Commit Message: test(coverage): add Behave BDD tests for 8 under-covered modules
  • Branch: test/improve-unit-test-coverage

Background and Context

The current coverage report (build/coverage.xml) shows several modules with missed lines and branches that can be improved with targeted Behave BDD tests. Increasing coverage on these files strengthens the project's safety net and ensures edge-case behavior is verified.

Target Files

File Current line-rate Current branch-rate Gaps
decision_service.py Not in report (uncovered) N/A Entire file needs coverage
plan_apply_service.py 1.0 0.9808 1 missed branch (line 426→432)
plan_executor.py 0.9426 0.9062 12 missed lines, 5 missed branches
plan.py (CLI) 0.9213 0.9174 63 missed lines, 9 missed branches
repositories.py 0.9978 0.9718 4 missed lines, 10 missed branches
checkpoint.py Not in report (uncovered) N/A Entire file needs coverage
bridge.py 0.9608 0.9091 6 missed lines, 4 missed branches
config.py (CLI) 1.0 1.0 Ensure coverage stays at 100%

Acceptance Criteria

  • New Behave feature files and step definitions exist for each of the 8 modules
  • Tests target specifically the missed lines and branches identified in the coverage report
  • All new tests pass when running nox -e unit_tests
  • No existing tests are broken by the new additions
  • Test files follow the BDD Test Organization Guidelines in CONTRIBUTING.md

Subtasks

  • Write Behave tests for decision_service.py
  • Write Behave tests for plan_apply_service.py (branch coverage)
  • Write Behave tests for plan_executor.py (lines 155, 161-163, 378, 409-419)
  • Write Behave tests for cli/commands/plan.py (lines 1950-2273)
  • Write Behave tests for repositories.py (lines 3541-3634, branches)
  • Write Behave tests for sandbox/checkpoint.py
  • Write Behave tests for langgraph/bridge.py (lines 35, 68, 201-204)
  • Write Behave tests for cli/commands/config.py (maintain 100%)
  • Run nox -e unit_tests and fix any failures

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, 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.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
## Metadata - **Commit Message**: `test(coverage): add Behave BDD tests for 8 under-covered modules` - **Branch**: `test/improve-unit-test-coverage` ## Background and Context The current coverage report (`build/coverage.xml`) shows several modules with missed lines and branches that can be improved with targeted Behave BDD tests. Increasing coverage on these files strengthens the project's safety net and ensures edge-case behavior is verified. ## Target Files | File | Current line-rate | Current branch-rate | Gaps | |------|------------------|---------------------|------| | `decision_service.py` | Not in report (uncovered) | N/A | Entire file needs coverage | | `plan_apply_service.py` | 1.0 | 0.9808 | 1 missed branch (line 426→432) | | `plan_executor.py` | 0.9426 | 0.9062 | 12 missed lines, 5 missed branches | | `plan.py` (CLI) | 0.9213 | 0.9174 | 63 missed lines, 9 missed branches | | `repositories.py` | 0.9978 | 0.9718 | 4 missed lines, 10 missed branches | | `checkpoint.py` | Not in report (uncovered) | N/A | Entire file needs coverage | | `bridge.py` | 0.9608 | 0.9091 | 6 missed lines, 4 missed branches | | `config.py` (CLI) | 1.0 | 1.0 | Ensure coverage stays at 100% | ## Acceptance Criteria - [ ] New Behave feature files and step definitions exist for each of the 8 modules - [ ] Tests target specifically the missed lines and branches identified in the coverage report - [ ] All new tests pass when running `nox -e unit_tests` - [ ] No existing tests are broken by the new additions - [ ] Test files follow the BDD Test Organization Guidelines in CONTRIBUTING.md ## Subtasks - [ ] Write Behave tests for `decision_service.py` - [ ] Write Behave tests for `plan_apply_service.py` (branch coverage) - [ ] Write Behave tests for `plan_executor.py` (lines 155, 161-163, 378, 409-419) - [ ] Write Behave tests for `cli/commands/plan.py` (lines 1950-2273) - [ ] Write Behave tests for `repositories.py` (lines 3541-3634, branches) - [ ] Write Behave tests for `sandbox/checkpoint.py` - [ ] Write Behave tests for `langgraph/bridge.py` (lines 35, 68, 201-204) - [ ] Write Behave tests for `cli/commands/config.py` (maintain 100%) - [ ] Run `nox -e unit_tests` and fix any failures ## 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, 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. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done.
freemo added this to the v3.4.0 milestone 2026-02-28 22:11:10 +00:00
freemo added reference test/improve-unit-test-coverage 2026-02-28 22:11:30 +00:00
Author
Owner

merged in

merged in
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#475
No description provided.