TEST-INFRA: [test-architecture] Name step files after their associated feature #1902

Open
opened 2026-04-03 00:10:09 +00:00 by freemo · 2 comments
Owner

Metadata

  • Branch: chore/test-arch-name-step-files-after-feature
  • Commit Message: chore(tests): rename step files to match their associated feature file names
  • Milestone: v3.2.0
  • Parent Epic: #739

Background and Context

The step files in the features/steps/ directory are not always named after the feature they are associated with. This makes it difficult to find the step definitions for a particular feature, and violates the BDD test organisation guidelines in CONTRIBUTING.md.

Per CONTRIBUTING.md: "Name feature-specific step files after their feature. Steps used only by a particular feature file should live in a correspondingly named step definition file."

For example, the step file for action_cli.feature should be named action_cli_steps.py. When step files are named inconsistently, contributors must search across multiple files to locate the relevant step definitions, increasing cognitive overhead and maintenance burden.

Expected Behavior

Each feature-specific step file in features/steps/ should be named after the feature file it supports, following the <feature_name>_steps.py convention. This makes the relationship between feature files and their step definitions immediately obvious.

Acceptance Criteria

  • All feature-specific step files in features/steps/ are named after the feature they are associated with (e.g., action_cli_steps.py for action_cli.feature)
  • The Behave test suite runs successfully after the step files have been renamed
  • No AmbiguousStep errors are introduced by the renaming
  • All tests pass (nox -s unit_tests runs to completion)
  • Coverage remains >= 97%

Supporting Information

  • CONTRIBUTING.md BDD Test Organisation Guidelines: "Name feature-specific step files after their feature."
  • Related test-architecture issues: #1847, #1864, #1872

Subtasks

  • Audit all step files in features/steps/ and identify those not named after their associated feature
  • Rename each misnamed step file to match the <feature_name>_steps.py convention
  • Verify Behave can still discover and load all step definitions after renaming
  • Run nox -s unit_tests to confirm no regressions or AmbiguousStep errors
  • Run full nox suite and confirm all sessions pass
  • Verify coverage >= 97% via nox -s coverage_report

Definition of Done

This issue is complete when:

  • All feature-specific step files in features/steps/ are named after their associated feature file
  • The Behave test suite runs successfully with no errors introduced by the renaming
  • All nox stages pass
  • Coverage >= 97%
  • 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

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

## Metadata - **Branch**: `chore/test-arch-name-step-files-after-feature` - **Commit Message**: `chore(tests): rename step files to match their associated feature file names` - **Milestone**: v3.2.0 - **Parent Epic**: #739 ## Background and Context The step files in the `features/steps/` directory are not always named after the feature they are associated with. This makes it difficult to find the step definitions for a particular feature, and violates the BDD test organisation guidelines in `CONTRIBUTING.md`. Per `CONTRIBUTING.md`: *"Name feature-specific step files after their feature. Steps used only by a particular feature file should live in a correspondingly named step definition file."* For example, the step file for `action_cli.feature` should be named `action_cli_steps.py`. When step files are named inconsistently, contributors must search across multiple files to locate the relevant step definitions, increasing cognitive overhead and maintenance burden. ## Expected Behavior Each feature-specific step file in `features/steps/` should be named after the feature file it supports, following the `<feature_name>_steps.py` convention. This makes the relationship between feature files and their step definitions immediately obvious. ## Acceptance Criteria - [ ] All feature-specific step files in `features/steps/` are named after the feature they are associated with (e.g., `action_cli_steps.py` for `action_cli.feature`) - [ ] The Behave test suite runs successfully after the step files have been renamed - [ ] No `AmbiguousStep` errors are introduced by the renaming - [ ] All tests pass (`nox -s unit_tests` runs to completion) - [ ] Coverage remains >= 97% ## Supporting Information - `CONTRIBUTING.md` BDD Test Organisation Guidelines: *"Name feature-specific step files after their feature."* - Related test-architecture issues: #1847, #1864, #1872 ## Subtasks - [ ] Audit all step files in `features/steps/` and identify those not named after their associated feature - [ ] Rename each misnamed step file to match the `<feature_name>_steps.py` convention - [ ] Verify Behave can still discover and load all step definitions after renaming - [ ] Run `nox -s unit_tests` to confirm no regressions or `AmbiguousStep` errors - [ ] Run full `nox` suite and confirm all sessions pass - [ ] Verify coverage >= 97% via `nox -s coverage_report` ## Definition of Done This issue is complete when: - [ ] All feature-specific step files in `features/steps/` are named after their associated feature file - [ ] The Behave test suite runs successfully with no errors introduced by the renaming - [ ] All nox stages pass - [ ] Coverage >= 97% - [ ] 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 --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: ca-new-issue-creator
freemo added this to the v3.2.0 milestone 2026-04-03 00:10:20 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • MoSCoW: MoSCoW/Could Have — CI/test infrastructure improvement.

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **MoSCoW**: MoSCoW/Could Have — CI/test infrastructure improvement. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • MoSCoW: MoSCoW/Could Have — CI/test infrastructure improvement.

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **MoSCoW**: MoSCoW/Could Have — CI/test infrastructure improvement. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
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#1902
No description provided.