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
file based integration tests #5067
Conversation
@Geal, please consider creating a changeset entry in |
CI performance tests
|
Love this! I do like the idea of grouping things by features and/or functionality. I'd love to see a separation of
Maybe in the future we can take it even further, and use snapshots to also store possible responses. And each "scenario" could have files for operations and responses that we can add and tweak as the router changes. |
having subfolders to separate different kinds of tests sounds nice |
I added support the subfolder because adding other files like the README interacted weirdly with the test runner, and subfolders definitely feel very nice to run this:
I added a README.md file to explain what to expect and how to write tests. The tests are now passing (I made them explicitely fail before to check the output locally and in CI), so this is good to review and merge |
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.
Great start! love it!
This defines a way to write integration tests using JSON files, to avoid the long linking times that we are suffering when writing unit or integration tests inside the Router. Writing and refining a test plan is a lot faster and lends itself more to a highly iterative way to work.
The way it works right now:
plan.json
file that contains a serie of actionsThis is currently an experimentation (with all tests failing on purpose), that we should adapt to our needs now that we can see it works. We could very well start using it ASAP and evolve it as needed, as we've done with other testing systems.
Things to decide on:
apollo_router/tests/samples
. Do we want to support grouping under subfolders? 'per feature, etc)apollo-router/tests
. I think this could work as a separate executable that could be used outside of the Router's CI. Example: to run a set of request/response for a customer, in a non public environmentChecklist
Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.
Exceptions
Note any exceptions here
Notes
Footnotes
It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this. ↩
Configuration is an important part of many changes. Where applicable please try to document configuration examples. ↩
Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions. ↩