Skip to content

Add verify:fixtures tooling to catch SDK-upgrade fixture drift - #69

Merged
BigDella merged 1 commit into
Parcel-Protocol:mainfrom
0xpreshh:feat/issue-26-fixture-verify
Sep 25, 2026
Merged

BigDella merged 1 commit into
Parcel-Protocol:mainfrom
0xpreshh:feat/issue-26-fixture-verify

Conversation

@0xpreshh

@0xpreshh 0xpreshh commented Sep 25, 2026 •

Copy link
Copy Markdown

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-sdk bump. 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, notBase64 in 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() walks features/*/fixtures/*.fixture.ts(x) across every slice
  • core/testing/__tests__/fixtures.contract.test.ts — dynamically imports each discovered fixture; it.each gives 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 into npm run check
  • docs/ARCHITECTURE.md — new SDK-upgrade section documenting this as a required step

Verifying 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/ReferenceError at import() 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

- 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
@drips-wave

drips-wave Bot commented Sep 25, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@BigDella
BigDella merged commit f297a4f into Parcel-Protocol:main Sep 25, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants