Utilities for writing unit tests for DDS in Fluid Framework.
NOTE: This package is private to the @microsoft/fluid-framework
repository.
It is not published, and therefore may only be used in packages within the same pnpm workspace in this repo using the workspace:* schema.
Since this package is not published, it may also only be used as a dev dependency, or as a dependency in packages that are not published.
gcTestRunner provides a set of tests for validating that the DDSes return correct GC nodes.
To write GC tests for a DDS, call runGCTests
with a class that implements the following interface:
export interface IGCTestProvider {
/** The DDS whose GC data is to be verified */
readonly sharedObject: ISharedObject;
/** The expected list of outbound routes from this DDS */
readonly expectedOutboundRoutes: string[];
/** Function that adds routes to Fluid objects to the DDS' data */
addOutboundRoutes(): Promise<void>;
/** Function that deletes routes to Fluid objects to the DDS' data */
deleteOutboundRoutes(): Promise<void>;
/** Function that adds nested handles to the DDS' data */
addNestedHandles(): Promise<void>;
}
The caller is responsible for the following:
- Adding and deleting routes to Fluid objects to the DDS which is being tested.
- Adding nested handles to the DDS' data.
- Maintaining the list of expected outbound routes. The tests query this and validates that the GC data returned by the DDS matches these routes.
SharedCell and SharedDirectory have tests that use the gcTestRunner for validating GC data.
This package also provides a generic harness for writing eventual consistency fuzz tests for a DDS.
This model is written using @fluid-private/stochastic-test-utils.
See documentation on createDDSFuzzSuite
and DDSFuzzModel
for more details.
The harness currently supports testing eventual consistency of op application using Fluid's set of mocks including the reconnect flow.
The generic aspects of this model could be improved to fuzz test correctness a few other general concerns DDS authors have:
- Summarization correctness
- Offline (
applyStashedOp
implementation)
There are many ways to contribute to Fluid.
- Participate in Q&A in our GitHub Discussions.
- Submit bugs and help us verify fixes as they are checked in.
- Review the source code changes.
- Contribute bug fixes.
Detailed instructions for working in the repo can be found in the Wiki.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services. Use of these trademarks or logos must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
Not finding what you're looking for in this README? Check out fluidframework.com.
Still not finding what you're looking for? Please file an issue.
Thank you!
This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
Use of these trademarks or logos must follow Microsoft's Trademark & Brand Guidelines.
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.