Internal Query: Adds In Memory Testing #2102
Closed
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.
Internal Query: Adds In Memory Testing
Description
This PR adds the ability to test queries in memory. It achieves this by wiring up the InMemoryContainer as the query source and mocks the request pipeline. We start by taking the user's query and sending it to ServiceInterop to get the query plan. From there we create a pipeline that uses InMemoryContainer as the datasource. The results are then drained using different execution modes ({client, compute} x {with state, without state}) and cross referenced for correctness. The result is also cross referenced with QueryOracle for correctness.
The idea for this PR is that we should be able to test end to end query scenarios without the need for an emulator. This will reduce the time it takes the gates to run and also remove flakiness. For deployments there is an implementation of the base testing class that calls into the actual CosmosClient, so we can be sure that everything works in production. These tests will be slower to run, but only need to be run during deployments.