refactor(tests): organize Behave feature files and step definitions into a hierarchical structure #3798

Open
opened 2026-04-06 06:23:51 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: refactor/test-architecture/hierarchical-feature-files
  • Commit Message: refactor(tests): organize behave feature files and step definitions into hierarchical structure
  • Milestone: (none — backlog)
  • Parent Epic: (see orphan note below)

Background

The current Behave test suite has all feature files and step definition files in flat directories (features/ and features/steps/). This makes it difficult to navigate, maintain, and understand the test suite as the codebase grows.

This issue proposes refactoring the Behave test suite into a hierarchical structure that mirrors the application's architecture, improving discoverability and long-term maintainability.

Proposed Structure

features/
├── a2a/
├── acms/
├── actor/
├── cli/
├── config/
├── coverage/
├── database/
├── decision/
├── devcontainer/
├── execution/
├── plan/
├── project/
├── resource/
├── skill/
├── smoke/
├── tdd/
├── tool/
├── tui/
├── validation/
└── shared/          # consolidated / common features

features/steps/ must be reorganized to mirror this same structure.

Subtasks

  • Create the new directory structure under features/
  • Move existing feature files into the appropriate subdirectories
  • Create the corresponding directory structure under features/steps/
  • Move existing step definition files into the appropriate subdirectories
  • Update the Behave configuration (behave.ini / pyproject.toml) to recognize the new structure
  • Verify all step imports and environment.py hooks resolve correctly after the move
  • Run the full test suite (nox -e unit_tests) to confirm all tests still pass
  • Update CONTRIBUTING.md to document the new hierarchical test layout

Definition of Done

  • All Behave feature files are organized into the hierarchical directory structure described above
  • All step definition files mirror the feature file hierarchy under features/steps/
  • nox -e unit_tests passes with zero failures
  • nox -e coverage_report reports coverage ≥ 97%
  • CONTRIBUTING.md documents the new test directory layout
  • All nox stages pass
  • Coverage >= 97%

Backlog note: This issue was discovered during autonomous operation
on milestone v3.7.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


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

## Metadata - **Branch**: `refactor/test-architecture/hierarchical-feature-files` - **Commit Message**: `refactor(tests): organize behave feature files and step definitions into hierarchical structure` - **Milestone**: *(none — backlog)* - **Parent Epic**: *(see orphan note below)* ## Background The current Behave test suite has all feature files and step definition files in flat directories (`features/` and `features/steps/`). This makes it difficult to navigate, maintain, and understand the test suite as the codebase grows. This issue proposes refactoring the Behave test suite into a hierarchical structure that mirrors the application's architecture, improving discoverability and long-term maintainability. ## Proposed Structure ``` features/ ├── a2a/ ├── acms/ ├── actor/ ├── cli/ ├── config/ ├── coverage/ ├── database/ ├── decision/ ├── devcontainer/ ├── execution/ ├── plan/ ├── project/ ├── resource/ ├── skill/ ├── smoke/ ├── tdd/ ├── tool/ ├── tui/ ├── validation/ └── shared/ # consolidated / common features ``` `features/steps/` must be reorganized to mirror this same structure. ## Subtasks - [ ] Create the new directory structure under `features/` - [ ] Move existing feature files into the appropriate subdirectories - [ ] Create the corresponding directory structure under `features/steps/` - [ ] Move existing step definition files into the appropriate subdirectories - [ ] Update the Behave configuration (`behave.ini` / `pyproject.toml`) to recognize the new structure - [ ] Verify all step imports and `environment.py` hooks resolve correctly after the move - [ ] Run the full test suite (`nox -e unit_tests`) to confirm all tests still pass - [ ] Update `CONTRIBUTING.md` to document the new hierarchical test layout ## Definition of Done - [ ] All Behave feature files are organized into the hierarchical directory structure described above - [ ] All step definition files mirror the feature file hierarchy under `features/steps/` - [ ] `nox -e unit_tests` passes with zero failures - [ ] `nox -e coverage_report` reports coverage ≥ 97% - [ ] `CONTRIBUTING.md` documents the new test directory layout - [ ] All nox stages pass - [ ] Coverage >= 97% > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.7.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: ca-new-issue-creator
Author
Owner

⚠️ Orphan Issue — Manual Linking Required

This issue was created without a known parent Epic. Per project rules in CONTRIBUTING.md, orphan issues are not permitted — every issue must be linked to a parent Epic using Forgejo's dependency system (child blocks parent).

Action required by a human reviewer:

  1. Identify the appropriate parent Epic for this test-architecture refactoring work (e.g., a "Hardening, Testing & Security" epic, or a future dedicated test-infrastructure epic).
  2. Create the dependency link so that this issue blocks the parent Epic:
    curl -s -X POST "https://git.cleverthis.com/api/v1/repos/cleveragents/cleveragents-core/issues/3798/blocks" \
      -H "Authorization: token <FORGEJO_PAT>" \
      -H "Content-Type: application/json" \
      -d '{"owner": "cleveragents", "repo": "cleveragents-core", "index": <PARENT_EPIC_NUMBER>}'
    

Suggested candidates (closest test-infrastructure epics currently open):

  • #1678 — Epic: CI Execution Time Optimization (v3.8.0)
  • #2810 — Epic: CI Quality Gates Restoration (v3.7.0) (marked duplicate)

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

⚠️ **Orphan Issue — Manual Linking Required** This issue was created without a known parent Epic. Per project rules in `CONTRIBUTING.md`, orphan issues are not permitted — every issue must be linked to a parent Epic using Forgejo's dependency system (child **blocks** parent). **Action required by a human reviewer:** 1. Identify the appropriate parent Epic for this test-architecture refactoring work (e.g., a "Hardening, Testing & Security" epic, or a future dedicated test-infrastructure epic). 2. Create the dependency link so that this issue **blocks** the parent Epic: ```bash curl -s -X POST "https://git.cleverthis.com/api/v1/repos/cleveragents/cleveragents-core/issues/3798/blocks" \ -H "Authorization: token <FORGEJO_PAT>" \ -H "Content-Type: application/json" \ -d '{"owner": "cleveragents", "repo": "cleveragents-core", "index": <PARENT_EPIC_NUMBER>}' ``` **Suggested candidates** (closest test-infrastructure epics currently open): - `#1678` — Epic: CI Execution Time Optimization (v3.8.0) - `#2810` — Epic: CI Quality Gates Restoration (v3.7.0) *(marked duplicate)* --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: ca-new-issue-creator
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.

Dependencies

No dependencies set.

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