Repository navigation
codegen: add golden tests and test data (PRINFRA-121) - #16
Merged
Merged
Conversation
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Apr 1, 2026
PRINFRA-121 CLI M1: OpenAPI codegen pipeline
Build the code generation pipeline that reads Scope
Mapping Rules
Acceptance Criteria
|
somanshreddy
force-pushed
the
04-01-codegen_add_golden_tests_and_test_data
branch
from
April 1, 2026 16:38
97aaada to
e10a625
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_renderer_templates_and_cli_entry_point
branch
from
April 1, 2026 16:38
cb080cf to
c0cc301
Compare
somanshreddy
force-pushed
the
04-01-codegen_add_golden_tests_and_test_data
branch
from
April 1, 2026 17:01
e10a625 to
e2df6d6
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_renderer_templates_and_cli_entry_point
branch
from
April 1, 2026 17:01
c0cc301 to
bc62a76
Compare
somanshreddy
marked this pull request as ready for review
April 1, 2026 17:29
jrusso1020
approved these changes
Apr 1, 2026
Collaborator
Author
Merge activity
|
somanshreddy
changed the base branch from
03-31-codegen_add_renderer_templates_and_cli_entry_point
to
graphite-base/16
April 1, 2026 19:20
Golden file tests run the full pipeline on a mini OpenAPI spec and compare output against checked-in expected files. Run with -update to refresh golden files after intentional changes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
somanshreddy
force-pushed
the
04-01-codegen_add_golden_tests_and_test_data
branch
from
April 1, 2026 19:23
e2df6d6 to
935528a
Compare
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.

Description
Proves the codegen pipeline produces correct output.
Golden file tests — a mini OpenAPI spec with 9 endpoints (CRUD, multipart, action with x-cli-action, hidden with x-cli-visible) runs through the full pipeline. Output is compared byte-for-byte against checked-in golden files.
To refresh golden files after intentional changes:
go test ./codegen/ -updateTest coverage:
Mini test spec covers:
Testing
Golden file comparison (3 output files: video.go, asset.go, registry.go) + example validation test.
Files
codegen/generate_test.go— golden file test + example validation testcodegen/testdata/mini_spec.json— minimal 9-endpoint OpenAPI speccodegen/testdata/golden/widget.go— expected video group outputcodegen/testdata/golden/upload.go— expected asset group outputcodegen/testdata/golden/registry.go— expected registry output