Add regression tests for the docs-schema generation path#5679
Draft
shreyas-goenka wants to merge 1 commit into
Draft
Add regression tests for the docs-schema generation path#5679shreyas-goenka wants to merge 1 commit into
shreyas-goenka wants to merge 1 commit into
Conversation
The docs schema (jsonschema_for_docs.json) is no longer generated or checked
in on main, so nothing here exercised the `--docs` build path; a regression in
it would only surface as missing/incorrect fields in the docs published to the
docgen branch at release time.
Extract the in-memory schema build into a git-free `buildSchema` (sinceVersion
stamping, which shells out to git tags, stays in the generator), then add two
fast unit tests against it:
- docs mode omits the interpolation-pattern transform (plain field types, not
the runtime `${...}` unions).
- the sinceVersion key round-trips: every key flattenSchema emits is applied by
addSinceVersionToSchema, reaching $defs and not just root properties. This
guards the two walks against drifting apart.
Behavior-preserving: regenerating jsonschema.json produces no diff.
Co-authored-by: Isaac
Collaborator
Integration test reportCommit: 3e7cbf6
24 interesting tests: 13 SKIP, 7 KNOWN, 4 flaky
Top 20 slowest tests (at least 2 minutes):
|
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.
Follow-up to #5677. That PR stopped generating/checking in the docs schema (
jsonschema_for_docs.json) on main, so nothing exercised the--docsbuild path anymore — a regression in it would only surface as missing/incorrect fields in the docs published to thedocgenbranch at release time (caught by a human, late). This addresses that review thread.Extract the in-memory schema build into a git-free
buildSchema(thesinceVersionstamping, which shells out togit tag, stays in the generator), then add two fast unit tests against it:TestBuildDocsSchemaOmitsInterpolationPatterns— docs mode drops the interpolation-pattern transform, so the published schema shows plain field types rather than the runtime${...}reference unions.TestDocsSchemaSinceVersionRoundTrip— every keyflattenSchemaemits is applied byaddSinceVersionToSchema, reaching$defsand not just root properties. Guards the two walks (key generation vs. application) against drifting apart, which would silently dropx-since-version.Both run in <0.2s (no git), and each was mutation-checked to confirm it fails when the behavior it guards is broken. The refactor is behavior-preserving: regenerating
jsonschema.jsonproduces no diff.