TEST-INFRA: [test-architecture] Improve organization of shared step definitions #3578

Open
opened 2026-04-05 20:03:49 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: chore/test-architecture-shared-step-definitions
  • Commit Message: chore(test-architecture): move shared step definitions to features/steps/shared/
  • Milestone: (backlog — see note below)
  • Parent Epic: #1678

Background and context

The project has a mature and well-structured test architecture that adheres to the BDD guidelines defined in CONTRIBUTING.md. The use of shared step definitions is a good practice that helps to reduce code duplication and improve the maintainability of the test suite.

Currently, shared step definitions are located in the features/steps directory, alongside feature-specific step definitions. While the naming convention helps to distinguish them, the large number of files in this directory can make it difficult to identify and reuse shared steps.

Proposal

To improve the organization of the step definitions and make it easier to find and reuse shared steps, I propose creating a dedicated directory for shared step definitions, for example, features/steps/shared.

This would involve:

  1. Creating a new directory features/steps/shared.
  2. Identifying all the shared step definition files in features/steps and moving them to the new features/steps/shared directory.
  3. Updating the Behave configuration to include the new directory in the search path for step definitions.

This change would improve the structure of the test suite and make it more maintainable in the long run.

Subtasks

  • Audit features/steps/ and identify all shared (cross-feature) step definition files
  • Create features/steps/shared/ directory
  • Move identified shared step definition files into features/steps/shared/
  • Update behave.ini (or equivalent Behave configuration) to add features/steps/shared to the step search path
  • Verify all existing Behave scenarios still pass: nox -e unit_tests
  • Run full nox suite to confirm no regressions: nox
  • Verify coverage >= 97%: nox -e coverage_report

Definition of Done

  • All shared step definition files are relocated to features/steps/shared/
  • Behave configuration correctly discovers steps from the new directory
  • All existing BDD scenarios pass without modification to .feature files
  • 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
  • All nox stages pass
  • Coverage >= 97%

Backlog note: This issue was discovered during autonomous operation
on milestone Test Infrastructure. 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**: `chore/test-architecture-shared-step-definitions` - **Commit Message**: `chore(test-architecture): move shared step definitions to features/steps/shared/` - **Milestone**: *(backlog — see note below)* - **Parent Epic**: #1678 ## Background and context The project has a mature and well-structured test architecture that adheres to the BDD guidelines defined in `CONTRIBUTING.md`. The use of shared step definitions is a good practice that helps to reduce code duplication and improve the maintainability of the test suite. Currently, shared step definitions are located in the `features/steps` directory, alongside feature-specific step definitions. While the naming convention helps to distinguish them, the large number of files in this directory can make it difficult to identify and reuse shared steps. ## Proposal To improve the organization of the step definitions and make it easier to find and reuse shared steps, I propose creating a dedicated directory for shared step definitions, for example, `features/steps/shared`. This would involve: 1. Creating a new directory `features/steps/shared`. 2. Identifying all the shared step definition files in `features/steps` and moving them to the new `features/steps/shared` directory. 3. Updating the Behave configuration to include the new directory in the search path for step definitions. This change would improve the structure of the test suite and make it more maintainable in the long run. ## Subtasks - [ ] Audit `features/steps/` and identify all shared (cross-feature) step definition files - [ ] Create `features/steps/shared/` directory - [ ] Move identified shared step definition files into `features/steps/shared/` - [ ] Update `behave.ini` (or equivalent Behave configuration) to add `features/steps/shared` to the step search path - [ ] Verify all existing Behave scenarios still pass: `nox -e unit_tests` - [ ] Run full nox suite to confirm no regressions: `nox` - [ ] Verify coverage >= 97%: `nox -e coverage_report` ## Definition of Done - [ ] All shared step definition files are relocated to `features/steps/shared/` - [ ] Behave configuration correctly discovers steps from the new directory - [ ] All existing BDD scenarios pass without modification to `.feature` files - [ ] 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 - [ ] All nox stages pass - [ ] Coverage >= 97% > **Backlog note:** This issue was discovered during autonomous operation > on milestone Test Infrastructure. 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
freemo added this to the v3.7.0 milestone 2026-04-05 20:16:34 +00:00
freemo removed this from the v3.7.0 milestone 2026-04-06 23:38:11 +00:00
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#3578
No description provided.