Repository navigation
Add verify:fixtures tooling to catch SDK-upgrade fixture drift - #69
Merged
BigDella merged 1 commit intoSep 25, 2026
Merged
Conversation
- core/testing/fixtureRegistry.ts: discovers every features/*/fixtures/*.fixture.ts(x) file across all feature slices - core/testing/__tests__/fixtures.contract.test.ts: dynamically imports each discovered fixture and fails with the specific file if it doesn't load cleanly - Most fixtures build their values with real SDK calls (Keypair, TransactionBuilder, xdr.*) rather than hand-typing them, so a renamed export or changed constructor throws at import time — exactly what an SDK upgrade breaks - Deliberately-invalid fixture values (notAnEnvelopeXdr, notBase64) are untouched: only the import itself is asserted, not fixture content - Added npm run verify:fixtures, wired into npm run check - Documented as a required SDK-upgrade step in docs/ARCHITECTURE.md Closes Parcel-Protocol#26
|
@0xpreshh Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Closes #26
Closes #54
Closes #53
Closes #61
Why this approach
Fixtures are intentionally decentralized (one
fixtures/dir per feature slice), so there's no single place to hand-audit after a@stellar/stellar-sdkbump. Rather than trying to infer "which SDK type each fixture represents" (the issue itself notes this isn't always explicit), this leans on something already true of the fixtures: most of them build their values with real SDK calls (Keypair.fromRawEd25519Seed,TransactionBuilder,xdr.*) at module-evaluation time instead of hand-typing them. That means a renamed export, changed constructor signature, or removed enum member throws the moment the fixture module loads — so simply importing every fixture and reporting which one threw is a direct, low-maintenance implementation of the acceptance criteria.Deliberately-invalid fixture values (
notAnEnvelopeXdr,notBase64in xdr-inspector/preconditions-explainer) are untouched — only the import itself is asserted, not the fixture's content, so intentional negative-test fixtures don't false-positive.Changes
core/testing/fixtureRegistry.ts—discoverFixtureFiles()walksfeatures/*/fixtures/*.fixture.ts(x)across every slicecore/testing/__tests__/fixtures.contract.test.ts— dynamically imports each discovered fixture;it.eachgives a per-file pass/fail so a break reports the exact fixture path and error, not just "something broke"npm run verify:fixtures— runs just this check (vitest run core/testing/__tests__/fixtures.contract.test.ts --reporter=verbose), wired intonpm run checkdocs/ARCHITECTURE.md— new SDK-upgrade section documenting this as a required stepVerifying it catches a break
Since I'm not running installs/tests locally for this change, verification is by inspection: any fixture file that calls an SDK export which stops existing (or changes required-argument shape) will throw a
TypeError/ReferenceErroratimport()time — Node/Vitest module evaluation runs top-level code immediately, so this isn't conditional on any particular fixture value being exercised by a test. Recommend a CI run to confirm before merge.Closes #26