Files
cleveragents-core/features/repo_indexing_utils_coverage.feature
T
freemo 051ee7c290
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 21s
CI / quality (pull_request) Successful in 31s
CI / typecheck (pull_request) Successful in 47s
CI / security (pull_request) Successful in 52s
CI / build (pull_request) Successful in 56s
CI / e2e_tests (pull_request) Successful in 5m1s
CI / integration_tests (pull_request) Successful in 5m30s
CI / unit_tests (pull_request) Successful in 5m42s
CI / docker (pull_request) Successful in 58s
CI / coverage (pull_request) Successful in 7m35s
CI / build (push) Successful in 21s
CI / docker (push) Has been skipped
CI / benchmark-regression (pull_request) Failing after 49m24s
CI / lint (push) Successful in 22s
CI / quality (push) Successful in 39s
CI / security (push) Successful in 48s
CI / typecheck (push) Successful in 1m26s
CI / benchmark-regression (push) Has been skipped
CI / e2e_tests (push) Successful in 5m53s
CI / coverage (push) Successful in 9m4s
CI / benchmark-publish (push) Successful in 19m10s
CI / integration_tests (push) Failing after 19m18s
CI / unit_tests (push) Failing after 19m20s
test(coverage): add Behave BDD tests to improve coverage across 52 source files
Added 52 new .feature files and corresponding _steps.py files targeting
previously uncovered code paths in the following areas:

- TUI layer: app, commands, persona (state/schema/registry), widgets,
  input (shell_exec, reference_parser)
- Application services: plan lifecycle/service/executor, session,
  project, repo indexing, correction, checkpoint, actor, llm_actors,
  strategy coordinator, resource file watcher, service retry wiring
- CLI commands: session, resource, repl, plan, db, automation_profile
- Domain models: retry_policy, resource_type, cost_budget,
  docker_compose_analyzer, detail_level, _sql_string_aware,
  _postgresql_helpers
- Core: circuit_breaker, retry_service_patterns
- Infrastructure: repositories, transaction_sandbox, strategy_registry,
  plugins/loader, container
- Config: settings
- Agents: plan_generation, context_analysis, auto_debug
- A2A: facade

All new tests follow the Behave/Gherkin BDD standard. Resolved step
definition collisions with unique prefixes. Fixed Alembic fileConfig
logger disabling issue (disable_existing_loggers=False).

ISSUES CLOSED: #1068
2026-03-20 21:22:10 +00:00

92 lines
4.0 KiB
Gherkin

Feature: Repo Indexing Utils Coverage
Scenarios that exercise previously uncovered code paths
in repo_indexing_utils.py (lines 118, 175, 266, 268, 269,
274, 281, 285, 286, 292-296, 306-307, 312, 338-342).
Background:
Given the repo indexing utils module is imported
# --- detect_language: Dockerfile special case (line 118) ---
Scenario: detect_language identifies Dockerfile by basename
When I detect the language for path "Dockerfile"
Then the detected language should be "dockerfile"
Scenario: detect_language identifies Dockerfile with suffix
When I detect the language for path "Dockerfile.prod"
Then the detected language should be "dockerfile"
Scenario: detect_language identifies Makefile by basename
When I detect the language for path "Makefile"
Then the detected language should be "makefile"
# --- _glob_match with ** or / in pattern (line 175) ---
Scenario: matches_policy uses recursive glob with double-star pattern
When I check matches_policy for "src/utils/helpers.py" with include glob "**/*.py"
Then the path should match the policy
Scenario: matches_policy uses path-based glob with slash in pattern
When I check matches_policy for "src/utils/helpers.py" with include glob "src/utils/*.py"
Then the path should match the policy
Scenario: matches_policy rejects path not matching recursive glob
When I check matches_policy for "src/utils/helpers.py" with include glob "**/*.rs"
Then the path should not match the policy
# --- walk_and_index: hidden directories filtered (lines 266, 268, 269) ---
Scenario: walk_and_index skips hidden directories and special directories
Given a temporary directory with hidden and special subdirectories
When I run walk_and_index on the temporary directory
Then only files from visible non-special directories should be indexed
# --- walk_and_index: hidden files skipped (line 274) ---
Scenario: walk_and_index skips hidden files
Given a temporary directory with hidden files
When I run walk_and_index on the directory with hidden files
Then hidden files should not appear in the results
# --- walk_and_index: symlinks skipped (line 281) ---
Scenario: walk_and_index skips symlinks
Given a temporary directory with a symlink to a file
When I run walk_and_index on the directory with symlinks
Then symlinked files should not appear in the results
# --- walk_and_index: ValueError on relative_to (lines 285-286) ---
Scenario: walk_and_index skips files when relative_to raises ValueError
Given a temporary directory with a file that will cause a relative_to ValueError
When I run walk_and_index with mocked relative_to failure
Then the file causing ValueError should be skipped gracefully
# --- walk_and_index: path > 1024 chars (lines 292-296) ---
Scenario: walk_and_index skips files with paths exceeding 1024 characters
Given a temporary directory with a deeply nested file exceeding 1024 char path
When I run walk_and_index on the deeply nested directory
Then the deeply nested file should be skipped
# --- walk_and_index: stat() raises OSError (lines 306-307) ---
Scenario: walk_and_index skips files when stat raises OSError
Given a temporary directory with a file that will cause a stat OSError
When I run walk_and_index with mocked stat failure
Then the file causing stat OSError should be skipped gracefully
# --- walk_and_index: non-regular file skipped (line 312) ---
Scenario: walk_and_index skips non-regular files like FIFOs
Given a temporary directory with a FIFO named pipe
When I run walk_and_index on the directory with the FIFO
Then the FIFO should not appear in the results
# --- walk_and_index: max_file_count cutoff (lines 338-342) ---
Scenario: walk_and_index stops after reaching max_file_count
Given a temporary directory with five regular files
When I run walk_and_index with max_file_count of 2
Then only 2 file records should be returned