TEST-INFRA: [test-data-quality] Improve test data by separating source code from fixtures #1661

Open
opened 2026-04-02 23:25:07 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: task/test-data-quality-refactor-fixtures
  • Commit Message: refactor(tests): separate source code from test data fixtures
  • Milestone: v3.9.0
  • Parent Epic: #376

Description

The current test data fixtures in features/fixtures/validation embed Python source code directly within the JSON files. While this is acceptable for small code snippets, it becomes difficult to manage and maintain for more complex test cases.

This issue proposes to refactor the test data fixtures to separate the source code from the fixture metadata. For fixtures that contain source code, the code should be moved to a separate .py file, and the JSON fixture should be updated to reference the file path.

Subtasks

  • Identify all JSON fixtures in features/fixtures/ that contain embedded source code.
  • For each fixture, create a new .py file containing the source code.
  • Update the JSON fixture to replace the source field with a source_file field that contains the path to the new .py file.
  • Update the test code that reads the fixtures to handle the new source_file field and load the source code from the specified file.

Definition of Done

  • All test data fixtures with embedded source code have been refactored to use separate .py files.
  • All tests that use these fixtures have been updated to load the source code from the new files.
  • All tests pass after the refactoring.
  • All nox stages pass
  • Coverage >= 97%

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

## Metadata - **Branch**: `task/test-data-quality-refactor-fixtures` - **Commit Message**: `refactor(tests): separate source code from test data fixtures` - **Milestone**: `v3.9.0` - **Parent Epic**: #376 ## Description The current test data fixtures in `features/fixtures/validation` embed Python source code directly within the JSON files. While this is acceptable for small code snippets, it becomes difficult to manage and maintain for more complex test cases. This issue proposes to refactor the test data fixtures to separate the source code from the fixture metadata. For fixtures that contain source code, the code should be moved to a separate `.py` file, and the JSON fixture should be updated to reference the file path. ## Subtasks - [ ] Identify all JSON fixtures in `features/fixtures/` that contain embedded source code. - [ ] For each fixture, create a new `.py` file containing the source code. - [ ] Update the JSON fixture to replace the `source` field with a `source_file` field that contains the path to the new `.py` file. - [ ] Update the test code that reads the fixtures to handle the new `source_file` field and load the source code from the specified file. ## Definition of Done - [ ] All test data fixtures with embedded source code have been refactored to use separate `.py` files. - [ ] All tests that use these fixtures have been updated to load the source code from the new files. - [ ] All tests pass after the refactoring. - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: ca-new-issue-creator
freemo added this to the v3.8.0 milestone 2026-04-02 23:26:43 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Priority/Low
  • MoSCoW: MoSCoW/Could Have — improving test data quality by separating source code from fixtures is a nice-to-have improvement. Could Have.

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

Issue triaged by project owner: - **State**: Verified - **Priority**: Priority/Low - **MoSCoW**: MoSCoW/Could Have — improving test data quality by separating source code from fixtures is a nice-to-have improvement. Could Have. --- **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.

Blocks
Reference
cleveragents/cleveragents-core#1661
No description provided.