TEST-INFRA: [test-data-quality] Use Scenario Outlines in legacy_migrator_coverage.feature #2457

Open
opened 2026-04-03 18:28:06 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: test/legacy-migrator-scenario-outlines
  • Commit Message: test(legacy_migrator): refactor legacy_migrator_coverage.feature to use Scenario Outlines
  • Milestone: v3.8.0
  • Parent Epic: #1678

Description

The scenarios in features/legacy_migrator_coverage.feature that test the mapping of status, context type, and operation values are repetitive and contain hardcoded data. This makes them harder to maintain and extend.

Recommendation:

Use Scenario Outlines to make these tests more data-driven. This will reduce duplication and make it easier to add new mapping tests in the future.

Example:

Scenario Outline: Map plan status values correctly
  Given I have a LegacyDataMigrator instance
  When I map plan status "<input_status>" to enum
  Then the migrator result should be <expected_status>

  Examples:
    | input_status | expected_status       |
    | "OVERLOADED" | PlanStatus.PENDING    |
    | "pending"    | PlanStatus.PENDING    |
    | "building"   | PlanStatus.BUILDING   |
    | "built"      | PlanStatus.BUILT      |
    | "failed"     | PlanStatus.ERROR      |
    | "applied"    | PlanStatus.APPLIED    |
    | "unknown"    | PlanStatus.PENDING    |

Subtasks

  • Audit features/legacy_migrator_coverage.feature for all hardcoded status, context type, and operation mapping values
  • Refactor affected scenarios into Scenario Outline blocks with Examples tables
  • Update step definitions in features/steps/ to accept outline parameters where needed
  • Verify no duplication remains across scenarios that can be collapsed into a single outline
  • Run nox -e unit_tests to confirm all scenarios pass with the new outline structure
  • Run nox -e coverage_report to confirm coverage remains >= 97%

Definition of Done

  • All hardcoded status mapping values in legacy_migrator_coverage.feature are replaced with outline parameters
  • All hardcoded context type and operation mapping values are replaced with outline parameters where applicable
  • Examples tables cover at least the original hardcoded values plus meaningful boundary cases
  • Step definitions correctly handle parameterised outline values
  • No scenario duplication remains that could be expressed as a single outline
  • All nox stages pass
  • Coverage >= 97%

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

## Metadata - **Branch**: `test/legacy-migrator-scenario-outlines` - **Commit Message**: `test(legacy_migrator): refactor legacy_migrator_coverage.feature to use Scenario Outlines` - **Milestone**: v3.8.0 - **Parent Epic**: #1678 ## Description The scenarios in `features/legacy_migrator_coverage.feature` that test the mapping of status, context type, and operation values are repetitive and contain hardcoded data. This makes them harder to maintain and extend. **Recommendation:** Use Scenario Outlines to make these tests more data-driven. This will reduce duplication and make it easier to add new mapping tests in the future. **Example:** ```gherkin Scenario Outline: Map plan status values correctly Given I have a LegacyDataMigrator instance When I map plan status "<input_status>" to enum Then the migrator result should be <expected_status> Examples: | input_status | expected_status | | "OVERLOADED" | PlanStatus.PENDING | | "pending" | PlanStatus.PENDING | | "building" | PlanStatus.BUILDING | | "built" | PlanStatus.BUILT | | "failed" | PlanStatus.ERROR | | "applied" | PlanStatus.APPLIED | | "unknown" | PlanStatus.PENDING | ``` ## Subtasks - [ ] Audit `features/legacy_migrator_coverage.feature` for all hardcoded status, context type, and operation mapping values - [ ] Refactor affected scenarios into `Scenario Outline` blocks with `Examples` tables - [ ] Update step definitions in `features/steps/` to accept outline parameters where needed - [ ] Verify no duplication remains across scenarios that can be collapsed into a single outline - [ ] Run `nox -e unit_tests` to confirm all scenarios pass with the new outline structure - [ ] Run `nox -e coverage_report` to confirm coverage remains >= 97% ## Definition of Done - [ ] All hardcoded status mapping values in `legacy_migrator_coverage.feature` are replaced with outline parameters - [ ] All hardcoded context type and operation mapping values are replaced with outline parameters where applicable - [ ] `Examples` tables cover at least the original hardcoded values plus meaningful boundary cases - [ ] Step definitions correctly handle parameterised outline values - [ ] No scenario duplication remains that could be expressed as a single outline - [ ] 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-03 18:28:22 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • MoSCoW: Could Have — Desirable improvement but not necessary for the milestone. Include only if time permits.

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

Issue triaged by project owner: - **State**: Verified - **MoSCoW**: Could Have — Desirable improvement but not necessary for the milestone. Include only if time permits. --- **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#2457
No description provided.