TEST-INFRA: [test-architecture] Organize helper files in robot directory #2220

Open
opened 2026-04-03 09:37:21 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: refactor/test-arch-organize-robot-helper-files
  • Commit Message: refactor(tests): organize helper files in robot directory into a dedicated subdirectory
  • Milestone: v3.8.0
  • Parent Epic: #1678

Background and Context

The robot/ directory currently contains 312 .robot test files and 275 Python helper files all in a single flat directory. This includes:

  • 262 helper_*.py files (one per .robot test file, providing keyword implementations)
  • 13 additional Python support files: _tdd_fixture_runner.py, common_vars.py, filter_output.py, helpers_common.py, indentation_library.py, json_helper.py, legacy_plan_removal_helper.py, tdd_expected_fail_listener.py, and the wf02_test_generation_*.py family

Per the project's File Organization guidelines in CONTRIBUTING.md, each directory should have a clear, single purpose — do not mix concerns. The current flat layout mixes .robot test suite files with Python helper/support modules, making it difficult to navigate, understand the directory's structure at a glance, and locate specific support code.

Organizing the helper files into a dedicated robot/helpers/ subdirectory (or equivalent) would:

  • Clearly separate Robot Framework test suite files (.robot) from their Python keyword implementations
  • Make the robot/ directory scannable at a glance
  • Align with the single-purpose directory principle from CONTRIBUTING.md

This issue is related to and complements:

  • #1963 — Refactor complex Robot helper files (simplify content)
  • #1717 — Organize Robot Framework tests into subdirectories (organize .robot files)

Current Behavior

All 275 Python helper files and 312 .robot test files coexist in the same flat robot/ directory. There is no structural separation between test suite files and their supporting Python keyword libraries.

Expected Behavior

Python helper files are moved into a dedicated subdirectory (e.g., robot/helpers/) so that the robot/ directory contains only .robot test files, .resource files, and top-level support files that Robot Framework requires at the root level. All helper_*.py imports within .robot files are updated to reflect the new path.

Acceptance Criteria

  • All helper_*.py files are relocated to a dedicated subdirectory within robot/
  • All other non-.robot Python support files are evaluated and either co-located in the helpers subdirectory or placed in an appropriate location
  • All .robot files that import from moved helper files are updated with the correct new paths
  • The full Robot Framework integration test suite passes without errors after the reorganization
  • nox (all default sessions) passes cleanly

Supporting Information

Current file counts in robot/:

  • .robot test files: 312
  • helper_*.py files: 262
  • Other Python support files: 13 (_tdd_fixture_runner.py, common_vars.py, filter_output.py, helpers_common.py, indentation_library.py, json_helper.py, legacy_plan_removal_helper.py, tdd_expected_fail_listener.py, wf02_test_generation_*.py family)
  • .resource files: 3 (common.resource, discovery_common.resource, v2_paths.resource)

Related issues: #1963, #1717, #1671, #1795

Subtasks

  • Audit all Python files in robot/ and categorize them (helper, listener, fixture runner, shared utility, etc.)
  • Decide on the target subdirectory structure (e.g., robot/helpers/ for all helper_*.py, separate locations for listeners/utilities)
  • Move all helper_*.py files to the chosen subdirectory
  • Move other Python support files to appropriate locations
  • Update all Library and Resource import paths in .robot files to reflect the new locations
  • Verify Robot Framework can resolve all imports after the move
  • Run nox -s integration_tests and confirm all Robot tests pass
  • Run nox (all default sessions) and fix any errors
  • Verify coverage >= 97% via nox -s coverage_report

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • 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%.

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

## Metadata - **Branch**: `refactor/test-arch-organize-robot-helper-files` - **Commit Message**: `refactor(tests): organize helper files in robot directory into a dedicated subdirectory` - **Milestone**: v3.8.0 - **Parent Epic**: #1678 ## Background and Context The `robot/` directory currently contains 312 `.robot` test files and 275 Python helper files all in a single flat directory. This includes: - 262 `helper_*.py` files (one per `.robot` test file, providing keyword implementations) - 13 additional Python support files: `_tdd_fixture_runner.py`, `common_vars.py`, `filter_output.py`, `helpers_common.py`, `indentation_library.py`, `json_helper.py`, `legacy_plan_removal_helper.py`, `tdd_expected_fail_listener.py`, and the `wf02_test_generation_*.py` family Per the project's **File Organization** guidelines in `CONTRIBUTING.md`, each directory should have a clear, single purpose — do not mix concerns. The current flat layout mixes `.robot` test suite files with Python helper/support modules, making it difficult to navigate, understand the directory's structure at a glance, and locate specific support code. Organizing the helper files into a dedicated `robot/helpers/` subdirectory (or equivalent) would: - Clearly separate Robot Framework test suite files (`.robot`) from their Python keyword implementations - Make the `robot/` directory scannable at a glance - Align with the single-purpose directory principle from `CONTRIBUTING.md` This issue is related to and complements: - #1963 — Refactor complex Robot helper files (simplify content) - #1717 — Organize Robot Framework tests into subdirectories (organize `.robot` files) ## Current Behavior All 275 Python helper files and 312 `.robot` test files coexist in the same flat `robot/` directory. There is no structural separation between test suite files and their supporting Python keyword libraries. ## Expected Behavior Python helper files are moved into a dedicated subdirectory (e.g., `robot/helpers/`) so that the `robot/` directory contains only `.robot` test files, `.resource` files, and top-level support files that Robot Framework requires at the root level. All `helper_*.py` imports within `.robot` files are updated to reflect the new path. ## Acceptance Criteria - All `helper_*.py` files are relocated to a dedicated subdirectory within `robot/` - All other non-`.robot` Python support files are evaluated and either co-located in the helpers subdirectory or placed in an appropriate location - All `.robot` files that import from moved helper files are updated with the correct new paths - The full Robot Framework integration test suite passes without errors after the reorganization - `nox` (all default sessions) passes cleanly ## Supporting Information Current file counts in `robot/`: - `.robot` test files: 312 - `helper_*.py` files: 262 - Other Python support files: 13 (`_tdd_fixture_runner.py`, `common_vars.py`, `filter_output.py`, `helpers_common.py`, `indentation_library.py`, `json_helper.py`, `legacy_plan_removal_helper.py`, `tdd_expected_fail_listener.py`, `wf02_test_generation_*.py` family) - `.resource` files: 3 (`common.resource`, `discovery_common.resource`, `v2_paths.resource`) Related issues: #1963, #1717, #1671, #1795 ## Subtasks - [ ] Audit all Python files in `robot/` and categorize them (helper, listener, fixture runner, shared utility, etc.) - [ ] Decide on the target subdirectory structure (e.g., `robot/helpers/` for all `helper_*.py`, separate locations for listeners/utilities) - [ ] Move all `helper_*.py` files to the chosen subdirectory - [ ] Move other Python support files to appropriate locations - [ ] Update all `Library` and `Resource` import paths in `.robot` files to reflect the new locations - [ ] Verify Robot Framework can resolve all imports after the move - [ ] Run `nox -s integration_tests` and confirm all Robot tests pass - [ ] Run `nox` (all default sessions) and fix any errors - [ ] Verify coverage >= 97% via `nox -s coverage_report` ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - 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%. --- **Automated by CleverAgents Bot** Supervisor: Unknown | Agent: ca-new-issue-creator
freemo added this to the v3.8.0 milestone 2026-04-03 09:37:54 +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#2220
No description provided.