Fail CI when the checked-in test clients drift - #96
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.