Repository navigation
Add shared emitter conformance fixtures and a cross-emitter check - #17
Open
magic-peach wants to merge 2 commits into
Open
magic-peach wants to merge 2 commits into
magic-peach wants to merge 2 commits into
Conversation
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.
Each emitter tests itself with its own harness, so nothing checks that they agree. Review of the Java emitter (#10) found bugs that other emitters had already fixed or avoided, which a shared fixture set would have caught once.
model/conformance:14-scalar-definition-references(properties that reference scalar, unconstrained, enum, and chained$defs) and15-keyword-property-names(reserved words in common languages). Their expected models are generated by the normalizer conformance test, which now lists them.expected/<case>/manifest-neutral.yamlfor every positive case: the part of the binding manifest that comes from the model, not the language (declarations, imported marker contracts, and root bindings).ci/emitter_conformance.pygenerates every positive case with each emitter and requires the neutral part of its manifest to equal the fixture. It has adapters for the Python, TypeScript and Rust emitters, an--updatemode, and unit tests that fail if a case has no fixture. A newverify-emitter-conformancejob runs it for Python and TypeScript.model/conformance/README.mdexplains the fixtures, how to check an emitter, and how to add a case.I ran the Python, TypeScript and Go emitter test suites against the two new cases (all pass), and the checker for Python and TypeScript: all 12 positive cases agree.
Two things it showed about the Go emitter, which is why it is not in the checker:
payload: {}in case 14) withRCG1024, where the other emitters produce an unconstrained type.I did not change the Go emitter, since that would change published manifests. The Rust emitter in #11 has an adapter here and agrees on all twelve cases when run locally. The CI job runs Python and TypeScript for now; adding Rust is one flag once #11 lands.