# Replace setup code copied into twenty test files

The same twelve lines of setup copied into every test file, replaced with one shared version.

Category: Test suite consolidation
Source: https://letsship.ai/use-cases/replace-a-hand-rolled-test-setup
Published: 2026-08-25

## Goal

Replace a setup block repeated across many test files with a single shared harness.

## Acceptance criteria

- The setup is defined once and imported
- Every migrated suite passes without changing what it asserts
- Suites needing a variation get it through an argument rather than a copy
- The number of files touched is stated in the description

## What lands as proof

One definition in the diff, and every migrated suite green without a changed assertion.

## Prompt

Copy this to an agent to open the ticket:

```text
Create a Linear issue in my team and assign it to the SHIP agent.

Title: Replace the repeated test setup with a shared harness

Description: Replace a setup block repeated across many test files with a single shared harness.

Acceptance criteria:
- The setup is defined once and imported
- Every migrated suite passes without changing what it asserts
- Suites needing a variation get it through an argument rather than a copy
- The number of files touched is stated in the description

Before you create the issue, find the setup block repeated most often across this repository's test files and quote it in the description.
```

## Questions

### What does the agent actually change?

The ticket is scoped to one outcome: replace a setup block repeated across many test files with a single shared harness. Work that serves that outcome is in scope, and anything outside it is left for a separate ticket, so the pull request stays reviewable.

### How do I know the work is done?

The pull request carries the evidence, not only the diff. Here that means the same tests pass with the setup defined exactly once, so a reviewer can confirm the result without reproducing the work locally.

### How much oversight does this need?

None is required before the run starts. Every claim this ticket makes can be checked by machine, so the agent works straight through and a person reviews the finished pull request like any other.
