(test) Added support for testing different compat version for Shared Tree in end-to-end tests #25915
+121
−9
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.
Currently, in the end-to-end tests, we only install and use the latest version of the shared tree package. So, irrespective of the compatibility mode that the test runs in, it doesn't really test any compaibility for shared tree.
In this change, I added the support to actually run shared tree tests in different compatibility mode. I also added a simple tree test that will run in full compat mode.
The details on the changes:
@fluidframework/treepackage Intest-version-utilsand expose it viaDataRuntimeApi. This package was exported starting in version 2.0.0, so I added a workaround to install the latest version when the compat version if < 2.0.0. This means that in cross-client compat mode where one of the versions is < 2.0.0, the test won't really be testing compatibility. This is acceptable because we don't expect collaboration between these tree versions.An alternative approach could be to not install the tree package in these scenarios and let the tests skip running in these scenarios. This way, tests don't accidentally assume that the scenario with a version < 2.0.0 is actually supported. However, that turns out to be complicated because the test infra assumes all packages to be installed. It is possible to change the test infra but I don't think it's worth doing that.
createGetDataStoreFactoryFunctionfunction that was added because the@fluidframework/treepackage was not installed by the test infra.The test skips running in the mdoe when one of the clients is supposed to be < 2.0.0. It does this because 1/ as described above, in this case, latest version of tree is used and 2/ id compressor is not supported by the runtime in < 2.0.0 and tree requires this.