Skip to content

Removed the test helpers nothing uses - #636

Open
xperiandri wants to merge 1 commit into
devfrom
test-helpers-cleanup
Open

xperiandri wants to merge 1 commit into
devfrom
test-helpers-cleanup

Conversation

@xperiandri

Copy link
Copy Markdown
Collaborator

Before the first MSTest projects arrive, the xUnit test projects drop what no test uses.

Changes

  • Dead helpers removed:
    • Helpers.fs: isType, isSeq, isDict, isNameValueDict, wantSome, wantNone, noErrors, throwsAsync, (<??), undefined, setEvent, resetEvent and waitEvent;
    • ErrorHelpers.fs: ensureExecutionError;
    • the integration tests' Helpers.fs: hasItems.
  • Duplicate helpers removed: InputEnumTests, InputListTests, InputNestedTests and InputNullableStringTests kept private copies of stringifyArg and stringifyInput, identical to the ones in Helpers.fs. They now use the shared ones.
  • Packages.props: removed the entries no project references: BenchmarkDotNet.Annotations, xunit.analyzers, xunit.v3.assert, xunit.v3.core, xunit.v3.extensibility.core, xunit.v3.runner.console and xunit.v3.runner.utility.

Kept on purpose:

  • hasErrorAtPath: no test on dev calls it yet, but a pending Relay change does.
  • TraitType and TraitName in TestAttributes.fs: the ObjectListFilter and LINQ tests use them.

Each removed helper and package was searched for on dev and on every branch active since June 2026, so merging those branches does not break the build.

Tests

The number of tests is unchanged. FAKE runs:

  • 769 unit tests: 764 passed, 5 skipped as before;
  • 2 + 106 integration tests.

🤖 Generated with Claude Code

The xUnit test projects carried helpers that no test calls any more, and four input test files kept private copies of a helper that `Helpers.fs` already provides.

- `Helpers.fs`: `isType`, `isSeq`, `isDict`, `isNameValueDict`, `wantSome`, `wantNone`, `noErrors`, `throwsAsync`, `(<??)`, `undefined`, `setEvent`, `resetEvent` and `waitEvent`
- `ErrorHelpers.fs`: `ensureExecutionError`; the integration tests' `Helpers.fs`: `hasItems`
- The copies of `stringifyArg` and `stringifyInput` in `InputEnumTests`, `InputListTests`, `InputNestedTests` and `InputNullableStringTests`, identical to the ones in `Helpers.fs`
- `Packages.props`: the entries no project references, `BenchmarkDotNet.Annotations`, `xunit.analyzers` and `xunit.v3.assert`, `.core`, `.extensibility.core`, `.runner.console` and `.runner.utility`

`hasErrorAtPath` stays: no test calls it yet, but the Relay hardening in progress does. The number of tests is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xperiandri
xperiandri marked this pull request as ready for review October 10, 2026 09:48
Copilot AI balanced review requested due to automatic review settings October 10, 2026 09:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The removed definitions are unreferenced, and the consolidated helpers are equivalent and available before all affected test modules.

0 open findings

What changed in this PR

Removes unused test helpers and redundant package version entries while consolidating input serialization helpers.

Changes:

  • Removed unused unit and integration test helpers.
  • Reused shared input-stringification helpers across four test modules.
  • Removed unreferenced package entries from central package management.
File Description
Packages.props Removes unused package version entries.
tests/​FSharp.Data.GraphQL.Tests/​Helpers.fs Removes unused shared test helpers.
tests/​FSharp.Data.GraphQL.Tests/​ErrorHelpers.fs Removes an unused execution-error helper.
tests/​FSharp.Data.GraphQL.IntegrationTests/​Helpers.fs Removes an unused collection helper.
tests/​FSharp.Data.GraphQL.Tests/​Variables and Inputs/​InputEnumTests.fs Uses shared stringification helpers.
tests/​FSharp.Data.GraphQL.Tests/​Variables and Inputs/​InputListTests.fs Uses shared stringification helpers.
tests/​FSharp.Data.GraphQL.Tests/​Variables and Inputs/​InputNestedTests.fs Uses shared helpers and removes an unnecessary import.
tests/​FSharp.Data.GraphQL.Tests/​Variables and Inputs/​InputNullableStringTests.fs Uses shared stringification helpers.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown

Test Results

    9 files      9 suites   14m 45s ⏱️
  877 tests   872 ✅  5 💤 0 ❌
2 631 runs  2 616 ✅ 15 💤 0 ❌

Results for commit bfd2be5.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants