Skip to content

Fail CI when the checked-in test clients drift - #96

Merged
joadan merged 1 commit into
mainfrom
buildtime-t4-preprocessing
Sep 7, 2026
Merged

joadan merged 1 commit into
mainfrom
buildtime-t4-preprocessing

Conversation

@joadan

@joadan joadan commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

test/Linq2GraphQL.TestClient and TestClientNullable hold generated output the test suite compiles against, but nothing refreshed it, so it silently drifted whenever a template or the test schema changed and the tests kept passing against stale code.

scripts/regenerate-test-clients.ps1 boots both test servers over plain HTTP and regenerates both clients with the flags that produced the committed output. The new generated-clients CI job runs it with -Check, which diffs the result and fails with instructions if it differs.

Refreshing the output cleared three pieces of accumulated drift:

  • the template edits activated by build-time T4 preprocessing (XML doc comments, an ArgumentNullException guard, indentation)
  • the signed Byte scalar mapping from 87b829c (byte -> sbyte), which the clients predate
  • the raiseError/raiseAuthError query methods added to the test schema

QueryNullableTests.GetItemData is adapted to the signed Byte mapping, and the test clients' ReadMe.txt files now point at the script instead of hand-written commands with hardcoded local paths.

test/Linq2GraphQL.TestClient and TestClientNullable hold generated output
the test suite compiles against, but nothing refreshed it, so it silently
drifted whenever a template or the test schema changed and the tests kept
passing against stale code.

scripts/regenerate-test-clients.ps1 boots both test servers over plain HTTP
and regenerates both clients with the flags that produced the committed
output. The new generated-clients CI job runs it with -Check, which diffs
the result and fails with instructions if it differs.

Refreshing the output cleared three pieces of accumulated drift:

- the template edits activated by build-time T4 preprocessing (XML doc
  comments, an ArgumentNullException guard, indentation)
- the signed Byte scalar mapping from 87b829c (byte -> sbyte), which the
  clients predate
- the raiseError/raiseAuthError query methods added to the test schema

QueryNullableTests.GetItemData is adapted to the signed Byte mapping, and
the test clients' ReadMe.txt files now point at the script instead of
hand-written commands with hardcoded local paths.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@joadan
joadan merged commit 57e8423 into main Sep 7, 2026
2 checks passed
@joadan
joadan deleted the buildtime-t4-preprocessing branch September 7, 2026 17:37
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.

1 participant