Skip to content

[Task]: Refactor ModularityKit.Mutator.Governance.Tests into focused fixtures #45

Description

@rian-be

Summary

Refactor ModularityKit.Mutator.Governance.Tests into smaller, scenario focused fixtures so governance execution, request lifecycle, approval, and resolution coverage do not accumulate inside broad test files.

Goal

Improve maintainability of governance package tests by decomposing oversized fixtures, extracting stable local test support where repetition is real, and aligning file boundaries with governance concerns.

Problem

ModularityKit.Mutator.Governance.Tests is starting to mix multiple governance concerns inside broad fixtures and repeated local setup. As governed execution, approval, resolution, and compensation scenarios expand, this makes the package harder to scan, harder to extend safely, and harder to review.

Scope

  • Split oversized governance test fixtures into focused files by concern
  • Isolate governed execution, compensation, approval, and resolution scenarios where they are currently bundled together
  • Extract stable local test support when setup or helper mutations repeat inside the package
  • Normalize naming so governance test files and fixtures match the scenario they cover
  • Keep refactoring scoped to ModularityKit.Mutator.Governance.Tests

Design Expectations

  • Test decomposition should preserve behavior while making scenario intent clearer.
  • Helpers should be extracted only where they remove real duplication.
  • Governance execution and compensation tests should remain readable without hiding core scenario flow.
  • File names and fixture names should reflect package-level governance concerns rather than mixed utility buckets.

Acceptance Criteria

  • ModularityKit.Mutator.Governance.Tests no longer relies on oversized mixed concern fixtures for its core governance scenarios
  • Governed execution and compensation scenarios live in focused test files or fixtures
  • Repeated local setup is extracted only where it improves readability and reuse
  • Naming across the package is more consistent and scenario-oriented

Non-Goals

  • This issue does not change governance runtime behavior or public APIs
  • This issue does not pull all test support into one cross package helper layer
  • This issue does not refactor Redis specific or core runtime tests outside this package

Notes

Implemented decomposition:

  • Execution coverage now lives in focused files for execution and compensation scenarios, with shared execution setup in local test support.
  • Query coverage now lives in focused request/filter and view files, with shared request builders extracted into local test support.
  • Approval coverage now lives in focused approval and expiration files, with shared workflow builders extracted into local test support.
  • Resolution and lifecycle coverage were already isolated in their own fixtures and stayed in place.

This keeps the governance test package readable while preserving the same behavioral coverage.

Metadata

Metadata

Assignees

Labels

testsTest coverage and test changes

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions