-
Notifications
You must be signed in to change notification settings - Fork 245
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 a query plan snapshot test harness #5110
Conversation
This allows porting tests such as found in `query-planner-js/src/__tests__/buildPlan.test.ts`
@SimonSapin, please consider creating a changeset entry in |
CI performance tests
|
/// Runs composition on the given subgraph schemas and return `(api_schema, query_planner)` | ||
/// | ||
/// Results of composition are cached in `tests/query_plan/supergraphs`. | ||
/// When needed, composition is done by starting a Rover subprocess | ||
/// (this requires a recent-enough version of `rover` to be in `$PATH`) | ||
/// but only if the `USE_ROVER=1` env variable is set. | ||
/// | ||
/// Panics if composition is needed but `USE_ROVER` is unset. |
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.
Can you add a few lines of dev docs on running these snapshots?
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.
What do you mean by running snapshots? Tests using this functionality are run like any other test with cargo test
or cargo nextest run
. If a cached supergraph is missing or out of date, the test will fail with a message that tells you what to do. (That is, run the test again with USE_ROVER=1
.)
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.
What I mean is adding a note about needing rover to be installed and explaining why and when it'll be necessary.
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.
It looks like we don't have a lot of docs on existing testing infrastructure, so I guess we can add this later when we document it all together.
This allows porting tests such as found in
query-planner-js/src/__tests__/buildPlan.test.ts