test(coverage): add Behave scenarios for under-tested modules #419

Merged
freemo merged 1 commits from test/improve-coverage into master 2026-02-24 17:54:37 +00:00
Owner

Summary

Adds Behave BDD scenarios targeting nine modules that had low or zero unit test coverage. Four modules previously had 0% coverage (config_service.py, correction_service.py, resource_handler_service.py, repl.py) and now have comprehensive test suites. Five additional modules with minor gaps (plan_executor.py, plan_lifecycle_service.py, plan.py CLI, skill.py CLI, models.py DB) receive targeted scenarios exercising their specific uncovered lines and branches.

Changes

New Test Files (18 files total — 9 feature + 9 step definition)

Module Feature File Steps File Scenarios
config_service.py config_service_coverage.feature config_service_coverage_steps.py Full public API
correction_service.py correction_service_coverage.feature correction_service_coverage_steps.py 50 scenarios covering request, impact analysis, dry-run, execute, dispatch, cancel, risk classification
resource_handler_service.py resource_handler_service_coverage.feature resource_handler_service_coverage_steps.py Full public API
repl.py repl_coverage.feature repl_coverage_steps.py Full public API
plan_executor.py plan_executor_coverage.feature plan_executor_coverage_steps.py Lines 144, 225, 233–235, 273, 483, 490
plan_lifecycle_service.py plan_lifecycle_service_persistence_coverage.feature plan_lifecycle_service_persistence_coverage_steps.py Lines 340–341, 376–380
plan.py (CLI) plan_cli_cancel_revert_coverage.feature plan_cli_cancel_revert_coverage_steps.py Lines 1817–1888 (cancel/revert)
skill.py (CLI) skill_cli_coverage.feature skill_cli_coverage_steps.py Lines 273, 343–344, 353, 393, 589–594
models.py (DB) database_models_missing_coverage.feature database_models_missing_coverage_steps.py Lines 1666, 1921, 2131–2132

No Production Code Changes

This PR is test-only. No files under src/ were modified.

Test Results

274 features passed, 0 failed, 0 errored, 7 skipped
5746 scenarios passed, 0 failed, 0 errored, 0 skipped
24906 steps passed, 0 failed, 0 errored, 0 skipped
nox > Session unit_tests-3.13 was successful in 12 minutes.

Related Issues

Closes #418

## Summary Adds Behave BDD scenarios targeting nine modules that had low or zero unit test coverage. Four modules previously had 0% coverage (`config_service.py`, `correction_service.py`, `resource_handler_service.py`, `repl.py`) and now have comprehensive test suites. Five additional modules with minor gaps (`plan_executor.py`, `plan_lifecycle_service.py`, `plan.py` CLI, `skill.py` CLI, `models.py` DB) receive targeted scenarios exercising their specific uncovered lines and branches. ## Changes ### New Test Files (18 files total — 9 feature + 9 step definition) | Module | Feature File | Steps File | Scenarios | |--------|-------------|------------|-----------| | `config_service.py` | `config_service_coverage.feature` | `config_service_coverage_steps.py` | Full public API | | `correction_service.py` | `correction_service_coverage.feature` | `correction_service_coverage_steps.py` | 50 scenarios covering request, impact analysis, dry-run, execute, dispatch, cancel, risk classification | | `resource_handler_service.py` | `resource_handler_service_coverage.feature` | `resource_handler_service_coverage_steps.py` | Full public API | | `repl.py` | `repl_coverage.feature` | `repl_coverage_steps.py` | Full public API | | `plan_executor.py` | `plan_executor_coverage.feature` | `plan_executor_coverage_steps.py` | Lines 144, 225, 233–235, 273, 483, 490 | | `plan_lifecycle_service.py` | `plan_lifecycle_service_persistence_coverage.feature` | `plan_lifecycle_service_persistence_coverage_steps.py` | Lines 340–341, 376–380 | | `plan.py` (CLI) | `plan_cli_cancel_revert_coverage.feature` | `plan_cli_cancel_revert_coverage_steps.py` | Lines 1817–1888 (cancel/revert) | | `skill.py` (CLI) | `skill_cli_coverage.feature` | `skill_cli_coverage_steps.py` | Lines 273, 343–344, 353, 393, 589–594 | | `models.py` (DB) | `database_models_missing_coverage.feature` | `database_models_missing_coverage_steps.py` | Lines 1666, 1921, 2131–2132 | ### No Production Code Changes This PR is test-only. No files under `src/` were modified. ### Test Results ``` 274 features passed, 0 failed, 0 errored, 7 skipped 5746 scenarios passed, 0 failed, 0 errored, 0 skipped 24906 steps passed, 0 failed, 0 errored, 0 skipped nox > Session unit_tests-3.13 was successful in 12 minutes. ``` ## Related Issues Closes #418
freemo added the
Type
Task
label 2026-02-24 16:18:33 +00:00
freemo added this to the v3.1.0 milestone 2026-02-24 16:18:39 +00:00
freemo force-pushed test/improve-coverage from 0bdac2665e to 4c336e658c 2026-02-24 17:00:08 +00:00 Compare
freemo force-pushed test/improve-coverage from 646c954cb0 to 3714971f6a 2026-02-24 17:18:54 +00:00 Compare
freemo force-pushed test/improve-coverage from 3714971f6a to 55aee7cf22 2026-02-24 17:19:13 +00:00 Compare
freemo scheduled this pull request to auto merge when all checks succeed 2026-02-24 17:33:43 +00:00
freemo merged commit 55aee7cf22 into master 2026-02-24 17:54:37 +00:00
freemo deleted branch test/improve-coverage 2026-02-24 17:54:38 +00:00
freemo added the
State
Completed
label 2026-03-04 00:58:31 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cleveragents/cleveragents-core#419