[RFC] Use markdown format for integration test snapshots#5137
Open
captbaritone wants to merge 4 commits intomainfrom
Open
[RFC] Use markdown format for integration test snapshots#5137captbaritone wants to merge 4 commits intomainfrom
captbaritone wants to merge 4 commits intomainfrom
Conversation
This RFC proposes migrating the relay_compiler_integration test snapshots from the legacy .expected format to markdown (.md) files with syntax highlighting. This change improves snapshot readability and review experience in editors and on GitHub. - Added `serialize_as_markdown()` method to ProjectFixture that outputs fenced code blocks with `title="filename"` syntax - Added language inference (js, ts, graphql, json) for syntax highlighting - Updated fixture-tests to detect .md files and use markdown formatting (## Input, ## Output, ## Error headers) - Made --expected-extension a CLI argument to support both formats - Created fixture_dirs_md.txt for markdown fixture directories - Updated fixture_dirs.txt to exclude relay_compiler_integration - Updated update-fixtures.sh to call fixture generator twice: once for .expected files, once for .md files - Renamed all 70 integration test snapshots from .expected to .md - Regenerated snapshots with proper markdown formatting - All 70 integration tests passing - Syntax highlighting in GitHub/editors improves readability - Easier to review snapshot changes in PRs - Better diff visualization - Preserves backward compatibility for other fixture tests See: https://jordaneldredge.com/markdown-snapshots/ Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Added file name as ### heading before each code block - Removed title attribute from code fence (redundant with heading) - Added blank line after each code block for better readability Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changed ### __generated__/foo.ts to ### `__generated__/foo.ts` for better markdown rendering. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1c2c11f to
0273280
Compare
Contributor
Author
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.
Summary
This RFC proposes migrating
relay_compiler_integrationtest snapshots from.expectedto.mdfiles with syntax highlighting for improved readability in editors and GitHub.Motivation: Markdown Snapshots - syntax highlighting makes snapshots easier to read and review.
Changes
serialize_as_markdown()to ProjectFixture with fenced code blocks--expected-extensiona CLI argument in fixture-tests.expected→.mdupdate-fixtures.shto handle both formatsExample
Before:
After:
Compatibility
✅ Other fixture tests unaffected - only `relay_compiler_integration` uses markdown
✅ All 70 tests passing
Questions