-
Notifications
You must be signed in to change notification settings - Fork 129
Add finer-grain reference tests for translation phase #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add finer-grain reference tests for translation phase #103
Conversation
Signed-off-by: Si Beaumont <beaumont@apple.com>
f4f5110
to
1ab10fe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, just one enhancement idea.
Tests/OpenAPIGeneratorReferenceTests/SnippetBasedReferenceTests.swift
Outdated
Show resolved
Hide resolved
Signed-off-by: Si Beaumont <beaumont@apple.com>
Signed-off-by: Si Beaumont <beaumont@apple.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question about the whitespace, otherwise lgtm!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9a56558
to
4b18a2b
Compare
Motivation
We have a reference test, which we've been making use of to validate end-to-end generation from OpenAPI document matches handwritten Swift files. This started out life as the canonical Petstore example from the OpenAPI specification but has since been augmented in various ways to test out some edge cases. This approach isn't scaling too well as we have an all-or-nothing test.
We also don't have great test coverage over the translation phase of the generator pipeline, which translates between the parsed OpenAPI document to an intermediate representation.
Modifications
Add test harnesses for finer grain reference tests that exercise smaller sections of the translation phase. It should allow us to test a small OpenAPI document renders to equivalent Swift source (stripping comments and reformatting).
Result
Hopefully a more modular and maintainable testing strategy as we try to support more of the OpenAPI specification.
Test Plan
This PR is tests.