@fluid-experimental/tree 2.0.0-rc.2.0.1 → 2.0.0-rc.3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/api-report/experimental-tree.api.md +2 -2
- package/dist/ChangeCompression.d.ts +2 -2
- package/dist/ChangeCompression.d.ts.map +1 -1
- package/dist/ChangeCompression.js +1 -1
- package/dist/ChangeCompression.js.map +1 -1
- package/dist/ChangeTypes.d.ts +1 -1
- package/dist/ChangeTypes.d.ts.map +1 -1
- package/dist/ChangeTypes.js +4 -4
- package/dist/ChangeTypes.js.map +1 -1
- package/dist/Checkout.d.ts +3 -3
- package/dist/Checkout.d.ts.map +1 -1
- package/dist/Checkout.js +17 -17
- package/dist/Checkout.js.map +1 -1
- package/dist/EditLog.d.ts +1 -1
- package/dist/EditLog.d.ts.map +1 -1
- package/dist/EditLog.js +9 -9
- package/dist/EditLog.js.map +1 -1
- package/dist/EditUtilities.d.ts +3 -3
- package/dist/EditUtilities.d.ts.map +1 -1
- package/dist/EditUtilities.js +6 -6
- package/dist/EditUtilities.js.map +1 -1
- package/dist/Forest.d.ts.map +1 -1
- package/dist/Forest.js +23 -23
- package/dist/Forest.js.map +1 -1
- package/dist/HistoryEditFactory.d.ts +1 -1
- package/dist/HistoryEditFactory.d.ts.map +1 -1
- package/dist/HistoryEditFactory.js +7 -7
- package/dist/HistoryEditFactory.js.map +1 -1
- package/dist/IdConversion.d.ts.map +1 -1
- package/dist/IdConversion.js.map +1 -1
- package/dist/LogViewer.d.ts +2 -2
- package/dist/LogViewer.d.ts.map +1 -1
- package/dist/LogViewer.js +7 -7
- package/dist/LogViewer.js.map +1 -1
- package/dist/MergeHealth.d.ts.map +1 -1
- package/dist/MergeHealth.js +1 -1
- package/dist/MergeHealth.js.map +1 -1
- package/dist/NodeIdUtilities.d.ts +1 -1
- package/dist/NodeIdUtilities.d.ts.map +1 -1
- package/dist/NodeIdUtilities.js +1 -1
- package/dist/NodeIdUtilities.js.map +1 -1
- package/dist/PayloadUtilities.d.ts.map +1 -1
- package/dist/PayloadUtilities.js +2 -2
- package/dist/PayloadUtilities.js.map +1 -1
- package/dist/ReconciliationPath.d.ts +1 -1
- package/dist/ReconciliationPath.d.ts.map +1 -1
- package/dist/ReconciliationPath.js.map +1 -1
- package/dist/RevisionValueCache.d.ts.map +1 -1
- package/dist/RevisionValueCache.js +2 -2
- package/dist/RevisionValueCache.js.map +1 -1
- package/dist/RevisionView.d.ts +2 -2
- package/dist/RevisionView.d.ts.map +1 -1
- package/dist/RevisionView.js.map +1 -1
- package/dist/SerializationUtilities.d.ts +1 -1
- package/dist/SerializationUtilities.d.ts.map +1 -1
- package/dist/SerializationUtilities.js.map +1 -1
- package/dist/SharedTree.d.ts +8 -7
- package/dist/SharedTree.d.ts.map +1 -1
- package/dist/SharedTree.js +78 -78
- package/dist/SharedTree.js.map +1 -1
- package/dist/SharedTreeEncoder.d.ts +1 -1
- package/dist/SharedTreeEncoder.d.ts.map +1 -1
- package/dist/SharedTreeEncoder.js +31 -31
- package/dist/SharedTreeEncoder.js.map +1 -1
- package/dist/Summary.d.ts +2 -2
- package/dist/Summary.d.ts.map +1 -1
- package/dist/Summary.js +2 -2
- package/dist/Summary.js.map +1 -1
- package/dist/SummaryBackCompatibility.d.ts.map +1 -1
- package/dist/SummaryBackCompatibility.js.map +1 -1
- package/dist/SummaryTestUtilities.d.ts +1 -1
- package/dist/SummaryTestUtilities.d.ts.map +1 -1
- package/dist/SummaryTestUtilities.js.map +1 -1
- package/dist/Transaction.d.ts +3 -3
- package/dist/Transaction.d.ts.map +1 -1
- package/dist/Transaction.js +3 -3
- package/dist/Transaction.js.map +1 -1
- package/dist/TransactionInternal.d.ts +3 -3
- package/dist/TransactionInternal.d.ts.map +1 -1
- package/dist/TransactionInternal.js +6 -6
- package/dist/TransactionInternal.js.map +1 -1
- package/dist/TreeCompressor.d.ts +5 -1
- package/dist/TreeCompressor.d.ts.map +1 -1
- package/dist/TreeCompressor.js +5 -5
- package/dist/TreeCompressor.js.map +1 -1
- package/dist/TreeNodeHandle.d.ts +1 -1
- package/dist/TreeNodeHandle.d.ts.map +1 -1
- package/dist/TreeNodeHandle.js.map +1 -1
- package/dist/TreeView.d.ts +1 -1
- package/dist/TreeView.d.ts.map +1 -1
- package/dist/TreeView.js +2 -3
- package/dist/TreeView.js.map +1 -1
- package/dist/UuidUtilities.d.ts.map +1 -1
- package/dist/UuidUtilities.js.map +1 -1
- package/dist/id-compressor/AppendOnlySortedMap.d.ts.map +1 -1
- package/dist/id-compressor/AppendOnlySortedMap.js +3 -3
- package/dist/id-compressor/AppendOnlySortedMap.js.map +1 -1
- package/dist/id-compressor/IdCompressor.d.ts +1 -1
- package/dist/id-compressor/IdCompressor.d.ts.map +1 -1
- package/dist/id-compressor/IdCompressor.js +25 -26
- package/dist/id-compressor/IdCompressor.js.map +1 -1
- package/dist/id-compressor/IdRange.d.ts.map +1 -1
- package/dist/id-compressor/IdRange.js +2 -2
- package/dist/id-compressor/IdRange.js.map +1 -1
- package/dist/id-compressor/NumericUuid.d.ts.map +1 -1
- package/dist/id-compressor/NumericUuid.js +2 -1
- package/dist/id-compressor/NumericUuid.js.map +1 -1
- package/dist/id-compressor/SessionIdNormalizer.d.ts.map +1 -1
- package/dist/id-compressor/SessionIdNormalizer.js +8 -9
- package/dist/id-compressor/SessionIdNormalizer.js.map +1 -1
- package/dist/migration-shim/migrationDeltaHandler.d.ts +1 -1
- package/dist/migration-shim/migrationDeltaHandler.d.ts.map +1 -1
- package/dist/migration-shim/migrationDeltaHandler.js +11 -11
- package/dist/migration-shim/migrationDeltaHandler.js.map +1 -1
- package/dist/migration-shim/migrationShim.d.ts +8 -4
- package/dist/migration-shim/migrationShim.d.ts.map +1 -1
- package/dist/migration-shim/migrationShim.js +13 -13
- package/dist/migration-shim/migrationShim.js.map +1 -1
- package/dist/migration-shim/migrationShimFactory.d.ts +2 -2
- package/dist/migration-shim/migrationShimFactory.d.ts.map +1 -1
- package/dist/migration-shim/migrationShimFactory.js +2 -2
- package/dist/migration-shim/migrationShimFactory.js.map +1 -1
- package/dist/migration-shim/packageVersion.d.ts +0 -2
- package/dist/migration-shim/packageVersion.d.ts.map +1 -1
- package/dist/migration-shim/packageVersion.js +0 -2
- package/dist/migration-shim/packageVersion.js.map +1 -1
- package/dist/migration-shim/sharedTreeDeltaHandler.d.ts.map +1 -1
- package/dist/migration-shim/sharedTreeDeltaHandler.js +8 -8
- package/dist/migration-shim/sharedTreeDeltaHandler.js.map +1 -1
- package/dist/migration-shim/sharedTreeShim.d.ts +2 -2
- package/dist/migration-shim/sharedTreeShim.d.ts.map +1 -1
- package/dist/migration-shim/sharedTreeShim.js +8 -4
- package/dist/migration-shim/sharedTreeShim.js.map +1 -1
- package/dist/migration-shim/sharedTreeShimFactory.d.ts +1 -1
- package/dist/migration-shim/sharedTreeShimFactory.d.ts.map +1 -1
- package/dist/migration-shim/sharedTreeShimFactory.js +2 -2
- package/dist/migration-shim/sharedTreeShimFactory.js.map +1 -1
- package/dist/migration-shim/shimChannelServices.d.ts +1 -1
- package/dist/migration-shim/shimChannelServices.d.ts.map +1 -1
- package/dist/migration-shim/shimChannelServices.js.map +1 -1
- package/dist/migration-shim/shimDeltaConnection.d.ts +1 -1
- package/dist/migration-shim/shimDeltaConnection.d.ts.map +1 -1
- package/dist/migration-shim/shimDeltaConnection.js +2 -2
- package/dist/migration-shim/shimDeltaConnection.js.map +1 -1
- package/dist/migration-shim/shimHandle.d.ts.map +1 -1
- package/dist/migration-shim/shimHandle.js.map +1 -1
- package/dist/migration-shim/types.d.ts +1 -1
- package/dist/migration-shim/types.d.ts.map +1 -1
- package/dist/migration-shim/types.js.map +1 -1
- package/dist/migration-shim/utils.d.ts +1 -1
- package/dist/migration-shim/utils.d.ts.map +1 -1
- package/dist/migration-shim/utils.js.map +1 -1
- package/dist/persisted-types/0.0.2.d.ts +1 -1
- package/dist/persisted-types/0.0.2.d.ts.map +1 -1
- package/dist/persisted-types/0.0.2.js.map +1 -1
- package/dist/persisted-types/0.1.1.d.ts +1 -1
- package/dist/persisted-types/0.1.1.d.ts.map +1 -1
- package/dist/persisted-types/0.1.1.js +3 -3
- package/dist/persisted-types/0.1.1.js.map +1 -1
- package/lib/ChangeCompression.d.ts +2 -2
- package/lib/ChangeCompression.d.ts.map +1 -1
- package/lib/ChangeCompression.js +1 -1
- package/lib/ChangeCompression.js.map +1 -1
- package/lib/ChangeTypes.d.ts +1 -1
- package/lib/ChangeTypes.d.ts.map +1 -1
- package/lib/ChangeTypes.js +2 -2
- package/lib/ChangeTypes.js.map +1 -1
- package/lib/Checkout.d.ts +3 -3
- package/lib/Checkout.d.ts.map +1 -1
- package/lib/Checkout.js +4 -4
- package/lib/Checkout.js.map +1 -1
- package/lib/EditLog.d.ts +1 -1
- package/lib/EditLog.d.ts.map +1 -1
- package/lib/EditLog.js +2 -2
- package/lib/EditLog.js.map +1 -1
- package/lib/EditUtilities.d.ts +3 -3
- package/lib/EditUtilities.d.ts.map +1 -1
- package/lib/EditUtilities.js +5 -5
- package/lib/EditUtilities.js.map +1 -1
- package/lib/Forest.d.ts.map +1 -1
- package/lib/Forest.js +2 -2
- package/lib/Forest.js.map +1 -1
- package/lib/HistoryEditFactory.d.ts +1 -1
- package/lib/HistoryEditFactory.d.ts.map +1 -1
- package/lib/HistoryEditFactory.js +5 -5
- package/lib/HistoryEditFactory.js.map +1 -1
- package/lib/IdConversion.d.ts.map +1 -1
- package/lib/IdConversion.js.map +1 -1
- package/lib/LogViewer.d.ts +2 -2
- package/lib/LogViewer.d.ts.map +1 -1
- package/lib/LogViewer.js +3 -3
- package/lib/LogViewer.js.map +1 -1
- package/lib/MergeHealth.d.ts.map +1 -1
- package/lib/MergeHealth.js +1 -1
- package/lib/MergeHealth.js.map +1 -1
- package/lib/NodeIdUtilities.d.ts +1 -1
- package/lib/NodeIdUtilities.d.ts.map +1 -1
- package/lib/NodeIdUtilities.js +1 -1
- package/lib/NodeIdUtilities.js.map +1 -1
- package/lib/PayloadUtilities.d.ts.map +1 -1
- package/lib/PayloadUtilities.js +1 -1
- package/lib/PayloadUtilities.js.map +1 -1
- package/lib/ReconciliationPath.d.ts +1 -1
- package/lib/ReconciliationPath.d.ts.map +1 -1
- package/lib/ReconciliationPath.js.map +1 -1
- package/lib/RevisionValueCache.d.ts.map +1 -1
- package/lib/RevisionValueCache.js +2 -2
- package/lib/RevisionValueCache.js.map +1 -1
- package/lib/RevisionView.d.ts +2 -2
- package/lib/RevisionView.d.ts.map +1 -1
- package/lib/RevisionView.js.map +1 -1
- package/lib/SerializationUtilities.d.ts +1 -1
- package/lib/SerializationUtilities.d.ts.map +1 -1
- package/lib/SerializationUtilities.js.map +1 -1
- package/lib/SharedTree.d.ts +8 -7
- package/lib/SharedTree.d.ts.map +1 -1
- package/lib/SharedTree.js +13 -13
- package/lib/SharedTree.js.map +1 -1
- package/lib/SharedTreeEncoder.d.ts +1 -1
- package/lib/SharedTreeEncoder.d.ts.map +1 -1
- package/lib/SharedTreeEncoder.js +5 -5
- package/lib/SharedTreeEncoder.js.map +1 -1
- package/lib/Summary.d.ts +2 -2
- package/lib/Summary.d.ts.map +1 -1
- package/lib/Summary.js +1 -1
- package/lib/Summary.js.map +1 -1
- package/lib/SummaryBackCompatibility.d.ts.map +1 -1
- package/lib/SummaryBackCompatibility.js.map +1 -1
- package/lib/SummaryTestUtilities.d.ts +1 -1
- package/lib/SummaryTestUtilities.d.ts.map +1 -1
- package/lib/SummaryTestUtilities.js.map +1 -1
- package/lib/Transaction.d.ts +3 -3
- package/lib/Transaction.d.ts.map +1 -1
- package/lib/Transaction.js +3 -3
- package/lib/Transaction.js.map +1 -1
- package/lib/TransactionInternal.d.ts +3 -3
- package/lib/TransactionInternal.d.ts.map +1 -1
- package/lib/TransactionInternal.js +3 -3
- package/lib/TransactionInternal.js.map +1 -1
- package/lib/TreeCompressor.d.ts +5 -1
- package/lib/TreeCompressor.d.ts.map +1 -1
- package/lib/TreeCompressor.js +2 -2
- package/lib/TreeCompressor.js.map +1 -1
- package/lib/TreeNodeHandle.d.ts +1 -1
- package/lib/TreeNodeHandle.d.ts.map +1 -1
- package/lib/TreeNodeHandle.js.map +1 -1
- package/lib/TreeView.d.ts +1 -1
- package/lib/TreeView.d.ts.map +1 -1
- package/lib/TreeView.js +1 -2
- package/lib/TreeView.js.map +1 -1
- package/lib/UuidUtilities.d.ts.map +1 -1
- package/lib/UuidUtilities.js +1 -1
- package/lib/UuidUtilities.js.map +1 -1
- package/lib/id-compressor/AppendOnlySortedMap.d.ts.map +1 -1
- package/lib/id-compressor/AppendOnlySortedMap.js +1 -1
- package/lib/id-compressor/AppendOnlySortedMap.js.map +1 -1
- package/lib/id-compressor/IdCompressor.d.ts +1 -1
- package/lib/id-compressor/IdCompressor.d.ts.map +1 -1
- package/lib/id-compressor/IdCompressor.js +4 -5
- package/lib/id-compressor/IdCompressor.js.map +1 -1
- package/lib/id-compressor/IdRange.d.ts.map +1 -1
- package/lib/id-compressor/IdRange.js +1 -1
- package/lib/id-compressor/IdRange.js.map +1 -1
- package/lib/id-compressor/NumericUuid.d.ts.map +1 -1
- package/lib/id-compressor/NumericUuid.js +2 -1
- package/lib/id-compressor/NumericUuid.js.map +1 -1
- package/lib/id-compressor/SessionIdNormalizer.d.ts.map +1 -1
- package/lib/id-compressor/SessionIdNormalizer.js +1 -2
- package/lib/id-compressor/SessionIdNormalizer.js.map +1 -1
- package/lib/migration-shim/migrationDeltaHandler.d.ts +1 -1
- package/lib/migration-shim/migrationDeltaHandler.d.ts.map +1 -1
- package/lib/migration-shim/migrationDeltaHandler.js +1 -1
- package/lib/migration-shim/migrationDeltaHandler.js.map +1 -1
- package/lib/migration-shim/migrationShim.d.ts +8 -4
- package/lib/migration-shim/migrationShim.d.ts.map +1 -1
- package/lib/migration-shim/migrationShim.js +3 -3
- package/lib/migration-shim/migrationShim.js.map +1 -1
- package/lib/migration-shim/migrationShimFactory.d.ts +2 -2
- package/lib/migration-shim/migrationShimFactory.d.ts.map +1 -1
- package/lib/migration-shim/migrationShimFactory.js +1 -1
- package/lib/migration-shim/migrationShimFactory.js.map +1 -1
- package/lib/migration-shim/packageVersion.d.ts +0 -2
- package/lib/migration-shim/packageVersion.d.ts.map +1 -1
- package/lib/migration-shim/packageVersion.js +0 -2
- package/lib/migration-shim/packageVersion.js.map +1 -1
- package/lib/migration-shim/sharedTreeDeltaHandler.d.ts.map +1 -1
- package/lib/migration-shim/sharedTreeDeltaHandler.js +1 -1
- package/lib/migration-shim/sharedTreeDeltaHandler.js.map +1 -1
- package/lib/migration-shim/sharedTreeShim.d.ts +2 -2
- package/lib/migration-shim/sharedTreeShim.d.ts.map +1 -1
- package/lib/migration-shim/sharedTreeShim.js +6 -2
- package/lib/migration-shim/sharedTreeShim.js.map +1 -1
- package/lib/migration-shim/sharedTreeShimFactory.d.ts +1 -1
- package/lib/migration-shim/sharedTreeShimFactory.d.ts.map +1 -1
- package/lib/migration-shim/sharedTreeShimFactory.js +1 -1
- package/lib/migration-shim/sharedTreeShimFactory.js.map +1 -1
- package/lib/migration-shim/shimChannelServices.d.ts +1 -1
- package/lib/migration-shim/shimChannelServices.d.ts.map +1 -1
- package/lib/migration-shim/shimChannelServices.js.map +1 -1
- package/lib/migration-shim/shimDeltaConnection.d.ts +1 -1
- package/lib/migration-shim/shimDeltaConnection.d.ts.map +1 -1
- package/lib/migration-shim/shimDeltaConnection.js +1 -1
- package/lib/migration-shim/shimDeltaConnection.js.map +1 -1
- package/lib/migration-shim/shimHandle.d.ts.map +1 -1
- package/lib/migration-shim/shimHandle.js.map +1 -1
- package/lib/migration-shim/types.d.ts +1 -1
- package/lib/migration-shim/types.d.ts.map +1 -1
- package/lib/migration-shim/types.js.map +1 -1
- package/lib/migration-shim/utils.d.ts +1 -1
- package/lib/migration-shim/utils.d.ts.map +1 -1
- package/lib/migration-shim/utils.js.map +1 -1
- package/lib/persisted-types/0.0.2.d.ts +1 -1
- package/lib/persisted-types/0.0.2.d.ts.map +1 -1
- package/lib/persisted-types/0.0.2.js.map +1 -1
- package/lib/persisted-types/0.1.1.d.ts +1 -1
- package/lib/persisted-types/0.1.1.d.ts.map +1 -1
- package/lib/persisted-types/0.1.1.js +1 -1
- package/lib/persisted-types/0.1.1.js.map +1 -1
- package/package.json +33 -32
- package/src/ChangeCompression.ts +8 -8
- package/src/ChangeTypes.ts +5 -4
- package/src/Checkout.ts +9 -7
- package/src/EditLog.ts +4 -3
- package/src/EditUtilities.ts +9 -8
- package/src/Forest.ts +3 -2
- package/src/HistoryEditFactory.ts +12 -11
- package/src/IdConversion.ts +2 -2
- package/src/LogViewer.ts +5 -4
- package/src/MergeHealth.ts +2 -1
- package/src/NodeIdUtilities.ts +2 -2
- package/src/PayloadUtilities.ts +2 -1
- package/src/ReconciliationPath.ts +1 -1
- package/src/RevisionValueCache.ts +3 -2
- package/src/RevisionView.ts +3 -3
- package/src/SerializationUtilities.ts +1 -1
- package/src/SharedTree.ts +46 -49
- package/src/SharedTreeEncoder.ts +30 -29
- package/src/Summary.ts +5 -3
- package/src/SummaryBackCompatibility.ts +1 -0
- package/src/SummaryTestUtilities.ts +2 -1
- package/src/Transaction.ts +7 -6
- package/src/TransactionInternal.ts +17 -16
- package/src/TreeCompressor.ts +6 -4
- package/src/TreeNodeHandle.ts +2 -2
- package/src/TreeView.ts +3 -3
- package/src/UuidUtilities.ts +2 -1
- package/src/id-compressor/AppendOnlySortedMap.ts +2 -1
- package/src/id-compressor/IdCompressor.ts +18 -17
- package/src/id-compressor/IdRange.ts +2 -1
- package/src/id-compressor/NumericUuid.ts +1 -1
- package/src/id-compressor/SessionIdNormalizer.ts +3 -3
- package/src/migration-shim/migrationDeltaHandler.ts +3 -2
- package/src/migration-shim/migrationShim.ts +14 -10
- package/src/migration-shim/migrationShimFactory.ts +6 -4
- package/src/migration-shim/packageVersion.ts +0 -2
- package/src/migration-shim/sharedTreeDeltaHandler.ts +3 -2
- package/src/migration-shim/sharedTreeShim.ts +7 -5
- package/src/migration-shim/sharedTreeShimFactory.ts +3 -3
- package/src/migration-shim/shimChannelServices.ts +1 -1
- package/src/migration-shim/shimDeltaConnection.ts +3 -2
- package/src/migration-shim/shimHandle.ts +1 -0
- package/src/migration-shim/types.ts +3 -1
- package/src/migration-shim/utils.ts +2 -1
- package/src/persisted-types/0.0.2.ts +2 -2
- package/src/persisted-types/0.1.1.ts +10 -8
- package/dist/tree-alpha.d.ts +0 -2901
- package/dist/tree-beta.d.ts +0 -348
- package/dist/tree-public.d.ts +0 -348
- package/dist/tree-untrimmed.d.ts +0 -3820
- package/lib/test/AppendOnlySortedMap.perf.tests.d.ts +0 -6
- package/lib/test/AppendOnlySortedMap.perf.tests.d.ts.map +0 -1
- package/lib/test/AppendOnlySortedMap.perf.tests.js +0 -49
- package/lib/test/AppendOnlySortedMap.perf.tests.js.map +0 -1
- package/lib/test/AppendOnlySortedMap.tests.d.ts +0 -6
- package/lib/test/AppendOnlySortedMap.tests.d.ts.map +0 -1
- package/lib/test/AppendOnlySortedMap.tests.js +0 -213
- package/lib/test/AppendOnlySortedMap.tests.js.map +0 -1
- package/lib/test/ChangeCompression.tests.d.ts +0 -6
- package/lib/test/ChangeCompression.tests.d.ts.map +0 -1
- package/lib/test/ChangeCompression.tests.js +0 -154
- package/lib/test/ChangeCompression.tests.js.map +0 -1
- package/lib/test/Checkout.tests.d.ts +0 -10
- package/lib/test/Checkout.tests.d.ts.map +0 -1
- package/lib/test/Checkout.tests.js +0 -460
- package/lib/test/Checkout.tests.js.map +0 -1
- package/lib/test/Common.tests.d.ts +0 -6
- package/lib/test/Common.tests.d.ts.map +0 -1
- package/lib/test/Common.tests.js +0 -102
- package/lib/test/Common.tests.js.map +0 -1
- package/lib/test/EagerCheckout.tests.d.ts +0 -6
- package/lib/test/EagerCheckout.tests.d.ts.map +0 -1
- package/lib/test/EagerCheckout.tests.js +0 -20
- package/lib/test/EagerCheckout.tests.js.map +0 -1
- package/lib/test/Edit.tests.d.ts +0 -6
- package/lib/test/Edit.tests.d.ts.map +0 -1
- package/lib/test/Edit.tests.js +0 -60
- package/lib/test/Edit.tests.js.map +0 -1
- package/lib/test/EditLog.perf.tests.d.ts +0 -6
- package/lib/test/EditLog.perf.tests.d.ts.map +0 -1
- package/lib/test/EditLog.perf.tests.js +0 -41
- package/lib/test/EditLog.perf.tests.js.map +0 -1
- package/lib/test/EditLog.tests.d.ts +0 -6
- package/lib/test/EditLog.tests.d.ts.map +0 -1
- package/lib/test/EditLog.tests.js +0 -355
- package/lib/test/EditLog.tests.js.map +0 -1
- package/lib/test/EditUtilities.tests.d.ts +0 -6
- package/lib/test/EditUtilities.tests.d.ts.map +0 -1
- package/lib/test/EditUtilities.tests.js +0 -512
- package/lib/test/EditUtilities.tests.js.map +0 -1
- package/lib/test/Forest.perf.tests.d.ts +0 -6
- package/lib/test/Forest.perf.tests.d.ts.map +0 -1
- package/lib/test/Forest.perf.tests.js +0 -135
- package/lib/test/Forest.perf.tests.js.map +0 -1
- package/lib/test/Forest.tests.d.ts +0 -6
- package/lib/test/Forest.tests.d.ts.map +0 -1
- package/lib/test/Forest.tests.js +0 -213
- package/lib/test/Forest.tests.js.map +0 -1
- package/lib/test/GenericTransaction.tests.d.ts +0 -6
- package/lib/test/GenericTransaction.tests.d.ts.map +0 -1
- package/lib/test/GenericTransaction.tests.js +0 -31
- package/lib/test/GenericTransaction.tests.js.map +0 -1
- package/lib/test/HistoryEditFactory.tests.d.ts +0 -6
- package/lib/test/HistoryEditFactory.tests.d.ts.map +0 -1
- package/lib/test/HistoryEditFactory.tests.js +0 -170
- package/lib/test/HistoryEditFactory.tests.js.map +0 -1
- package/lib/test/IdCompressor.perf.tests.d.ts +0 -6
- package/lib/test/IdCompressor.perf.tests.d.ts.map +0 -1
- package/lib/test/IdCompressor.perf.tests.js +0 -290
- package/lib/test/IdCompressor.perf.tests.js.map +0 -1
- package/lib/test/IdCompressor.tests.d.ts +0 -6
- package/lib/test/IdCompressor.tests.d.ts.map +0 -1
- package/lib/test/IdCompressor.tests.js +0 -1542
- package/lib/test/IdCompressor.tests.js.map +0 -1
- package/lib/test/IdConversion.tests.d.ts +0 -6
- package/lib/test/IdConversion.tests.d.ts.map +0 -1
- package/lib/test/IdConversion.tests.js +0 -36
- package/lib/test/IdConversion.tests.js.map +0 -1
- package/lib/test/LazyCheckout.tests.d.ts +0 -6
- package/lib/test/LazyCheckout.tests.d.ts.map +0 -1
- package/lib/test/LazyCheckout.tests.js +0 -22
- package/lib/test/LazyCheckout.tests.js.map +0 -1
- package/lib/test/LogViewer.tests.d.ts +0 -6
- package/lib/test/LogViewer.tests.d.ts.map +0 -1
- package/lib/test/LogViewer.tests.js +0 -588
- package/lib/test/LogViewer.tests.js.map +0 -1
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.d.ts +0 -6
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.d.ts.map +0 -1
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.js +0 -351
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.js.map +0 -1
- package/lib/test/NumericUuid.perf.tests.d.ts +0 -6
- package/lib/test/NumericUuid.perf.tests.d.ts.map +0 -1
- package/lib/test/NumericUuid.perf.tests.js +0 -68
- package/lib/test/NumericUuid.perf.tests.js.map +0 -1
- package/lib/test/NumericUuid.tests.d.ts +0 -6
- package/lib/test/NumericUuid.tests.d.ts.map +0 -1
- package/lib/test/NumericUuid.tests.js +0 -192
- package/lib/test/NumericUuid.tests.js.map +0 -1
- package/lib/test/RevisionValueCache.tests.d.ts +0 -6
- package/lib/test/RevisionValueCache.tests.d.ts.map +0 -1
- package/lib/test/RevisionValueCache.tests.js +0 -106
- package/lib/test/RevisionValueCache.tests.js.map +0 -1
- package/lib/test/RevisionView.tests.d.ts +0 -6
- package/lib/test/RevisionView.tests.d.ts.map +0 -1
- package/lib/test/RevisionView.tests.js +0 -131
- package/lib/test/RevisionView.tests.js.map +0 -1
- package/lib/test/SessionIdNormalizer.tests.d.ts +0 -6
- package/lib/test/SessionIdNormalizer.tests.d.ts.map +0 -1
- package/lib/test/SessionIdNormalizer.tests.js +0 -377
- package/lib/test/SessionIdNormalizer.tests.js.map +0 -1
- package/lib/test/SharedTree.fuzz.tests.d.ts +0 -6
- package/lib/test/SharedTree.fuzz.tests.d.ts.map +0 -1
- package/lib/test/SharedTree.fuzz.tests.js +0 -9
- package/lib/test/SharedTree.fuzz.tests.js.map +0 -1
- package/lib/test/SharedTree.perf.tests.d.ts +0 -6
- package/lib/test/SharedTree.perf.tests.d.ts.map +0 -1
- package/lib/test/SharedTree.perf.tests.js +0 -39
- package/lib/test/SharedTree.perf.tests.js.map +0 -1
- package/lib/test/SharedTree.tests.d.ts +0 -6
- package/lib/test/SharedTree.tests.d.ts.map +0 -1
- package/lib/test/SharedTree.tests.js +0 -22
- package/lib/test/SharedTree.tests.js.map +0 -1
- package/lib/test/StringInterner.tests.d.ts +0 -6
- package/lib/test/StringInterner.tests.d.ts.map +0 -1
- package/lib/test/StringInterner.tests.js +0 -73
- package/lib/test/StringInterner.tests.js.map +0 -1
- package/lib/test/Summary.tests.d.ts +0 -7
- package/lib/test/Summary.tests.d.ts.map +0 -1
- package/lib/test/Summary.tests.js +0 -386
- package/lib/test/Summary.tests.js.map +0 -1
- package/lib/test/Transaction.tests.d.ts +0 -6
- package/lib/test/Transaction.tests.d.ts.map +0 -1
- package/lib/test/Transaction.tests.js +0 -124
- package/lib/test/Transaction.tests.js.map +0 -1
- package/lib/test/TransactionInternal.tests.d.ts +0 -6
- package/lib/test/TransactionInternal.tests.d.ts.map +0 -1
- package/lib/test/TransactionInternal.tests.js +0 -576
- package/lib/test/TransactionInternal.tests.js.map +0 -1
- package/lib/test/TreeCompression.tests.d.ts +0 -6
- package/lib/test/TreeCompression.tests.d.ts.map +0 -1
- package/lib/test/TreeCompression.tests.js +0 -291
- package/lib/test/TreeCompression.tests.js.map +0 -1
- package/lib/test/TreeView.tests.d.ts +0 -6
- package/lib/test/TreeView.tests.d.ts.map +0 -1
- package/lib/test/TreeView.tests.js +0 -178
- package/lib/test/TreeView.tests.js.map +0 -1
- package/lib/test/UndoRedoHandler.tests.d.ts +0 -6
- package/lib/test/UndoRedoHandler.tests.d.ts.map +0 -1
- package/lib/test/UndoRedoHandler.tests.js +0 -37
- package/lib/test/UndoRedoHandler.tests.js.map +0 -1
- package/lib/test/fuzz/Generators.d.ts +0 -8
- package/lib/test/fuzz/Generators.d.ts.map +0 -1
- package/lib/test/fuzz/Generators.js +0 -345
- package/lib/test/fuzz/Generators.js.map +0 -1
- package/lib/test/fuzz/SharedTreeFuzzTests.d.ts +0 -23
- package/lib/test/fuzz/SharedTreeFuzzTests.d.ts.map +0 -1
- package/lib/test/fuzz/SharedTreeFuzzTests.js +0 -241
- package/lib/test/fuzz/SharedTreeFuzzTests.js.map +0 -1
- package/lib/test/fuzz/Types.d.ts +0 -136
- package/lib/test/fuzz/Types.d.ts.map +0 -1
- package/lib/test/fuzz/Types.js +0 -6
- package/lib/test/fuzz/Types.js.map +0 -1
- package/lib/test/utilities/IdCompressorTestUtilities.d.ts +0 -246
- package/lib/test/utilities/IdCompressorTestUtilities.d.ts.map +0 -1
- package/lib/test/utilities/IdCompressorTestUtilities.js +0 -608
- package/lib/test/utilities/IdCompressorTestUtilities.js.map +0 -1
- package/lib/test/utilities/MockTransaction.d.ts +0 -35
- package/lib/test/utilities/MockTransaction.d.ts.map +0 -1
- package/lib/test/utilities/MockTransaction.js +0 -51
- package/lib/test/utilities/MockTransaction.js.map +0 -1
- package/lib/test/utilities/PendingLocalStateTests.d.ts +0 -12
- package/lib/test/utilities/PendingLocalStateTests.d.ts.map +0 -1
- package/lib/test/utilities/PendingLocalStateTests.js +0 -223
- package/lib/test/utilities/PendingLocalStateTests.js.map +0 -1
- package/lib/test/utilities/SharedTreeTests.d.ts +0 -12
- package/lib/test/utilities/SharedTreeTests.d.ts.map +0 -1
- package/lib/test/utilities/SharedTreeTests.js +0 -949
- package/lib/test/utilities/SharedTreeTests.js.map +0 -1
- package/lib/test/utilities/SharedTreeVersioningTests.d.ts +0 -11
- package/lib/test/utilities/SharedTreeVersioningTests.d.ts.map +0 -1
- package/lib/test/utilities/SharedTreeVersioningTests.js +0 -439
- package/lib/test/utilities/SharedTreeVersioningTests.js.map +0 -1
- package/lib/test/utilities/SummaryLoadPerfTests.d.ts +0 -10
- package/lib/test/utilities/SummaryLoadPerfTests.d.ts.map +0 -1
- package/lib/test/utilities/SummaryLoadPerfTests.js +0 -105
- package/lib/test/utilities/SummaryLoadPerfTests.js.map +0 -1
- package/lib/test/utilities/SummarySizeTests.d.ts +0 -11
- package/lib/test/utilities/SummarySizeTests.d.ts.map +0 -1
- package/lib/test/utilities/SummarySizeTests.js +0 -160
- package/lib/test/utilities/SummarySizeTests.js.map +0 -1
- package/lib/test/utilities/TestCommon.d.ts +0 -13
- package/lib/test/utilities/TestCommon.d.ts.map +0 -1
- package/lib/test/utilities/TestCommon.js +0 -19
- package/lib/test/utilities/TestCommon.js.map +0 -1
- package/lib/test/utilities/TestNode.d.ts +0 -140
- package/lib/test/utilities/TestNode.d.ts.map +0 -1
- package/lib/test/utilities/TestNode.js +0 -282
- package/lib/test/utilities/TestNode.js.map +0 -1
- package/lib/test/utilities/TestSerializer.d.ts +0 -24
- package/lib/test/utilities/TestSerializer.d.ts.map +0 -1
- package/lib/test/utilities/TestSerializer.js +0 -40
- package/lib/test/utilities/TestSerializer.js.map +0 -1
- package/lib/test/utilities/TestUtilities.d.ts +0 -212
- package/lib/test/utilities/TestUtilities.d.ts.map +0 -1
- package/lib/test/utilities/TestUtilities.js +0 -413
- package/lib/test/utilities/TestUtilities.js.map +0 -1
- package/lib/test/utilities/UndoRedoTests.d.ts +0 -32
- package/lib/test/utilities/UndoRedoTests.d.ts.map +0 -1
- package/lib/test/utilities/UndoRedoTests.js +0 -317
- package/lib/test/utilities/UndoRedoTests.js.map +0 -1
- /package/{dist → lib}/tsdoc-metadata.json +0 -0
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { join } from 'path';
|
|
6
|
-
import * as fs from 'fs';
|
|
7
|
-
import { takeAsync } from '@fluid-private/stochastic-test-utils';
|
|
8
|
-
import { benchmark, BenchmarkType } from '@fluid-tools/benchmark';
|
|
9
|
-
import { WriteFormat } from '../../persisted-types/index.js';
|
|
10
|
-
import { performFuzzActions } from '../fuzz/SharedTreeFuzzTests.js';
|
|
11
|
-
import { makeOpGenerator } from '../fuzz/Generators.js';
|
|
12
|
-
import { areRevisionViewsSemanticallyEqual } from '../../EditUtilities.js';
|
|
13
|
-
import { setUpLocalServerTestSharedTree, setUpTestSharedTree, testDocumentsPathBase } from './TestUtilities.js';
|
|
14
|
-
import { expectAssert } from './TestCommon.js';
|
|
15
|
-
const directory = join(testDocumentsPathBase, 'summary-load-perf-tests');
|
|
16
|
-
/**
|
|
17
|
-
* Runs a test suite for summary load perf on `SharedTree`.
|
|
18
|
-
* This suite can be used to test other implementations that aim to fulfill `SharedTree`'s contract.
|
|
19
|
-
*/
|
|
20
|
-
export function runSummaryLoadPerfTests(title) {
|
|
21
|
-
describe(title, () => {
|
|
22
|
-
// Re-enable this test for an easy way to write the test summary files to disk
|
|
23
|
-
it.skip('save files to disk', async () => {
|
|
24
|
-
await writeSummaryTestTrees();
|
|
25
|
-
});
|
|
26
|
-
const { summaryFileWithHistory_0_0_2, summaryFileNoHistory_0_0_2, summaryFileWithHistory_0_1_1, summaryFileNoHistory_0_1_1,
|
|
27
|
-
// blobsFile: string;
|
|
28
|
-
} = loadSummaryTestFiles();
|
|
29
|
-
const tests = [
|
|
30
|
-
{ title: 'load 0.0.2 format without history', file: summaryFileNoHistory_0_0_2 },
|
|
31
|
-
{ title: 'load 0.0.2 format with history', file: summaryFileWithHistory_0_0_2 },
|
|
32
|
-
{ title: 'load 0.1.1 format without history', file: summaryFileNoHistory_0_1_1 },
|
|
33
|
-
{ title: 'load 0.1.1 format with history', file: summaryFileWithHistory_0_1_1 },
|
|
34
|
-
];
|
|
35
|
-
for (const { title, file } of tests) {
|
|
36
|
-
benchmark({
|
|
37
|
-
type: BenchmarkType.Measurement,
|
|
38
|
-
title,
|
|
39
|
-
benchmarkFn: () => {
|
|
40
|
-
const { tree } = setUpTestSharedTree({ writeFormat: WriteFormat.v0_0_2 });
|
|
41
|
-
tree.loadSerializedSummary(file);
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
async function generateRandomTree(seed, maxTreeSize, writeFormat, summarizeHistory) {
|
|
48
|
-
const generator = takeAsync(1000, makeOpGenerator({
|
|
49
|
-
editConfig: { maxTreeSize },
|
|
50
|
-
joinConfig: {
|
|
51
|
-
writeFormat: [writeFormat],
|
|
52
|
-
summarizeHistory: [summarizeHistory],
|
|
53
|
-
maximumActiveCollaborators: 2,
|
|
54
|
-
maximumPassiveCollaborators: 0,
|
|
55
|
-
},
|
|
56
|
-
}));
|
|
57
|
-
const { testObjectProvider } = await performFuzzActions(generator, seed, true);
|
|
58
|
-
const { tree: finalTree } = await setUpLocalServerTestSharedTree({
|
|
59
|
-
testObjectProvider,
|
|
60
|
-
summarizeHistory,
|
|
61
|
-
writeFormat,
|
|
62
|
-
});
|
|
63
|
-
await testObjectProvider.ensureSynchronized();
|
|
64
|
-
return finalTree;
|
|
65
|
-
}
|
|
66
|
-
async function writeSummaryTestTrees() {
|
|
67
|
-
if (!fs.existsSync(directory)) {
|
|
68
|
-
fs.mkdirSync(directory);
|
|
69
|
-
}
|
|
70
|
-
const seed = 24601;
|
|
71
|
-
const tree002 = await generateRandomTree(seed, 1000, WriteFormat.v0_0_2, true);
|
|
72
|
-
const tree011 = await generateRandomTree(seed, 1000, WriteFormat.v0_1_1, true);
|
|
73
|
-
const tree002NoHistory = await generateRandomTree(seed, 1000, WriteFormat.v0_0_2, false);
|
|
74
|
-
const tree011NoHistory = await generateRandomTree(seed, 1000, WriteFormat.v0_1_1, false);
|
|
75
|
-
expectAssert(areRevisionViewsSemanticallyEqual(tree002.currentView, tree002, tree011.currentView, tree011));
|
|
76
|
-
expectAssert(areRevisionViewsSemanticallyEqual(tree002.currentView, tree002, tree002NoHistory.currentView, tree002NoHistory));
|
|
77
|
-
expectAssert(areRevisionViewsSemanticallyEqual(tree011.currentView, tree011, tree011NoHistory.currentView, tree011NoHistory));
|
|
78
|
-
const { promises: fsP } = fs;
|
|
79
|
-
await fsP.writeFile(join(directory, 'summary-0-0-2.json'), tree002.saveSerializedSummary());
|
|
80
|
-
await fsP.writeFile(join(directory, 'summary-0-1-1.json'), tree011.saveSerializedSummary());
|
|
81
|
-
await fsP.writeFile(join(directory, 'summary-no-history-0-0-2.json'), tree002NoHistory.saveSerializedSummary());
|
|
82
|
-
await fsP.writeFile(join(directory, 'summary-no-history-0-1-1.json'), tree011NoHistory.saveSerializedSummary());
|
|
83
|
-
}
|
|
84
|
-
function loadSummaryTestFiles() {
|
|
85
|
-
const readFile = (name) => {
|
|
86
|
-
const contents = fs.readFileSync(join(directory, name), 'utf-8');
|
|
87
|
-
// Round-trip the file so that performance testing summary doesn't require parsing unnecessary/unrealistic whitespace
|
|
88
|
-
return JSON.stringify(JSON.parse(contents));
|
|
89
|
-
};
|
|
90
|
-
const summaryFileWithHistory_0_0_2 = readFile('summary-0-0-2.json');
|
|
91
|
-
const summaryFileNoHistory_0_0_2 = readFile('summary-no-history-0-0-2.json');
|
|
92
|
-
const summaryFileWithHistory_0_1_1 = readFile('summary-0-1-1.json');
|
|
93
|
-
const summaryFileNoHistory_0_1_1 = readFile('summary-no-history-0-1-1.json');
|
|
94
|
-
// Note: We don't bother writing/reading a "blobs" file for this test suite because loading a serialized summary
|
|
95
|
-
// with history should never involve attempting to get any of those blobs.
|
|
96
|
-
// This *is* a fair comparison from a perf perspective b/c the whole point of chunking edit history is to decrease
|
|
97
|
-
// summary size for potentially unused edit information.
|
|
98
|
-
return {
|
|
99
|
-
summaryFileWithHistory_0_0_2,
|
|
100
|
-
summaryFileNoHistory_0_0_2,
|
|
101
|
-
summaryFileWithHistory_0_1_1,
|
|
102
|
-
summaryFileNoHistory_0_1_1,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
//# sourceMappingURL=SummaryLoadPerfTests.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SummaryLoadPerfTests.js","sourceRoot":"","sources":["../../../src/test/utilities/SummaryLoadPerfTests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iCAAiC,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,8BAA8B,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,SAAS,GAAG,IAAI,CAAC,qBAAqB,EAAE,yBAAyB,CAAC,CAAC;AAEzE;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAa;IACpD,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE;QACpB,8EAA8E;QAC9E,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,KAAK,IAAI,EAAE;YACxC,MAAM,qBAAqB,EAAE,CAAC;QAC/B,CAAC,CAAC,CAAC;QAEH,MAAM,EACL,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AC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { join } from 'path';\nimport * as fs from 'fs';\nimport { takeAsync } from '@fluid-private/stochastic-test-utils';\nimport { benchmark, BenchmarkType } from '@fluid-tools/benchmark';\nimport { SharedTree } from '../../SharedTree.js';\nimport { WriteFormat } from '../../persisted-types/index.js';\nimport { performFuzzActions } from '../fuzz/SharedTreeFuzzTests.js';\nimport { makeOpGenerator } from '../fuzz/Generators.js';\nimport { areRevisionViewsSemanticallyEqual } from '../../EditUtilities.js';\nimport { setUpLocalServerTestSharedTree, setUpTestSharedTree, testDocumentsPathBase } from './TestUtilities.js';\nimport { expectAssert } from './TestCommon.js';\n\nconst directory = join(testDocumentsPathBase, 'summary-load-perf-tests');\n\n/**\n * Runs a test suite for summary load perf on `SharedTree`.\n * This suite can be used to test other implementations that aim to fulfill `SharedTree`'s contract.\n */\nexport function runSummaryLoadPerfTests(title: string): void {\n\tdescribe(title, () => {\n\t\t// Re-enable this test for an easy way to write the test summary files to disk\n\t\tit.skip('save files to disk', async () => {\n\t\t\tawait writeSummaryTestTrees();\n\t\t});\n\n\t\tconst {\n\t\t\tsummaryFileWithHistory_0_0_2,\n\t\t\tsummaryFileNoHistory_0_0_2,\n\t\t\tsummaryFileWithHistory_0_1_1,\n\t\t\tsummaryFileNoHistory_0_1_1,\n\t\t\t// blobsFile: string;\n\t\t} = loadSummaryTestFiles();\n\n\t\tconst tests = [\n\t\t\t{ title: 'load 0.0.2 format without history', file: summaryFileNoHistory_0_0_2 },\n\t\t\t{ title: 'load 0.0.2 format with history', file: summaryFileWithHistory_0_0_2 },\n\t\t\t{ title: 'load 0.1.1 format without history', file: summaryFileNoHistory_0_1_1 },\n\t\t\t{ title: 'load 0.1.1 format with history', file: summaryFileWithHistory_0_1_1 },\n\t\t];\n\n\t\tfor (const { title, file } of tests) {\n\t\t\tbenchmark({\n\t\t\t\ttype: BenchmarkType.Measurement,\n\t\t\t\ttitle,\n\t\t\t\tbenchmarkFn: () => {\n\t\t\t\t\tconst { tree } = setUpTestSharedTree({ writeFormat: WriteFormat.v0_0_2 });\n\t\t\t\t\ttree.loadSerializedSummary(file);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t});\n}\n\nasync function generateRandomTree(\n\tseed: number,\n\tmaxTreeSize: number,\n\twriteFormat: WriteFormat,\n\tsummarizeHistory: boolean\n): Promise<SharedTree> {\n\tconst generator = takeAsync(\n\t\t1000,\n\t\tmakeOpGenerator({\n\t\t\teditConfig: { maxTreeSize },\n\t\t\tjoinConfig: {\n\t\t\t\twriteFormat: [writeFormat],\n\t\t\t\tsummarizeHistory: [summarizeHistory],\n\t\t\t\tmaximumActiveCollaborators: 2,\n\t\t\t\tmaximumPassiveCollaborators: 0,\n\t\t\t},\n\t\t})\n\t);\n\tconst { testObjectProvider } = await performFuzzActions(generator, seed, true);\n\tconst { tree: finalTree } = await setUpLocalServerTestSharedTree({\n\t\ttestObjectProvider,\n\t\tsummarizeHistory,\n\t\twriteFormat,\n\t});\n\tawait testObjectProvider.ensureSynchronized();\n\treturn finalTree;\n}\n\nasync function writeSummaryTestTrees(): Promise<void> {\n\tif (!fs.existsSync(directory)) {\n\t\tfs.mkdirSync(directory);\n\t}\n\n\tconst seed = 24601;\n\tconst tree002 = await generateRandomTree(seed, 1000, WriteFormat.v0_0_2, true);\n\tconst tree011 = await generateRandomTree(seed, 1000, WriteFormat.v0_1_1, true);\n\tconst tree002NoHistory = await generateRandomTree(seed, 1000, WriteFormat.v0_0_2, false);\n\tconst tree011NoHistory = await generateRandomTree(seed, 1000, WriteFormat.v0_1_1, false);\n\n\texpectAssert(areRevisionViewsSemanticallyEqual(tree002.currentView, tree002, tree011.currentView, tree011));\n\texpectAssert(\n\t\tareRevisionViewsSemanticallyEqual(tree002.currentView, tree002, tree002NoHistory.currentView, tree002NoHistory)\n\t);\n\texpectAssert(\n\t\tareRevisionViewsSemanticallyEqual(tree011.currentView, tree011, tree011NoHistory.currentView, tree011NoHistory)\n\t);\n\tconst { promises: fsP } = fs;\n\tawait fsP.writeFile(join(directory, 'summary-0-0-2.json'), tree002.saveSerializedSummary());\n\tawait fsP.writeFile(join(directory, 'summary-0-1-1.json'), tree011.saveSerializedSummary());\n\tawait fsP.writeFile(join(directory, 'summary-no-history-0-0-2.json'), tree002NoHistory.saveSerializedSummary());\n\tawait fsP.writeFile(join(directory, 'summary-no-history-0-1-1.json'), tree011NoHistory.saveSerializedSummary());\n}\n\nfunction loadSummaryTestFiles(): {\n\tsummaryFileWithHistory_0_0_2: string;\n\tsummaryFileNoHistory_0_0_2: string;\n\tsummaryFileWithHistory_0_1_1: string;\n\tsummaryFileNoHistory_0_1_1: string;\n} {\n\tconst readFile = (name: string): string => {\n\t\tconst contents = fs.readFileSync(join(directory, name), 'utf-8');\n\t\t// Round-trip the file so that performance testing summary doesn't require parsing unnecessary/unrealistic whitespace\n\t\treturn JSON.stringify(JSON.parse(contents));\n\t};\n\tconst summaryFileWithHistory_0_0_2 = readFile('summary-0-0-2.json');\n\tconst summaryFileNoHistory_0_0_2 = readFile('summary-no-history-0-0-2.json');\n\tconst summaryFileWithHistory_0_1_1 = readFile('summary-0-1-1.json');\n\tconst summaryFileNoHistory_0_1_1 = readFile('summary-no-history-0-1-1.json');\n\n\t// Note: We don't bother writing/reading a \"blobs\" file for this test suite because loading a serialized summary\n\t// with history should never involve attempting to get any of those blobs.\n\t// This *is* a fair comparison from a perf perspective b/c the whole point of chunking edit history is to decrease\n\t// summary size for potentially unused edit information.\n\n\treturn {\n\t\tsummaryFileWithHistory_0_0_2,\n\t\tsummaryFileNoHistory_0_0_2,\n\t\tsummaryFileWithHistory_0_1_1,\n\t\tsummaryFileNoHistory_0_1_1,\n\t};\n}\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { LocalServerSharedTreeTestingComponents, LocalServerSharedTreeTestingOptions } from './TestUtilities.js';
|
|
6
|
-
/**
|
|
7
|
-
* Runs a test suite for summaries on `SharedTree` that verifies their sizes do not exceed the defined limits.
|
|
8
|
-
* This suite can be used to test other implementations that aim to fulfill `SharedTree`'s contract.
|
|
9
|
-
*/
|
|
10
|
-
export declare function runSummarySizeTests(title: string, setUpLocalServerTestSharedTree: (options: LocalServerSharedTreeTestingOptions) => Promise<LocalServerSharedTreeTestingComponents>): void;
|
|
11
|
-
//# sourceMappingURL=SummarySizeTests.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SummarySizeTests.d.ts","sourceRoot":"","sources":["../../../src/test/utilities/SummarySizeTests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,OAAO,EACN,sCAAsC,EACtC,mCAAmC,EAEnC,MAAM,oBAAoB,CAAC;AAwF5B;;;GAGG;AACH,wBAAgB,mBAAmB,CAClC,KAAK,EAAE,MAAM,EACb,8BAA8B,EAAE,CAC/B,OAAO,EAAE,mCAAmC,KACxC,OAAO,CAAC,sCAAsC,CAAC,QAuDpD"}
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { IsoBuffer } from '@fluid-internal/client-utils';
|
|
6
|
-
import { expect } from 'chai';
|
|
7
|
-
import { fail } from '../../Common.js';
|
|
8
|
-
import { Change, StablePlace, StableRange } from '../../ChangeTypes.js';
|
|
9
|
-
import { revert } from '../../HistoryEditFactory.js';
|
|
10
|
-
import { IdCompressor } from '../../id-compressor/index.js';
|
|
11
|
-
import { setUpTestTree, } from './TestUtilities.js';
|
|
12
|
-
/**
|
|
13
|
-
* Summary size tests where `edits` are applied and checked against the `expectedSize`.
|
|
14
|
-
*/
|
|
15
|
-
const summarySizeTests = [
|
|
16
|
-
{
|
|
17
|
-
edits: (testTree) => [
|
|
18
|
-
Change.insertTree(testTree.buildLeaf(), StablePlace.atEndOf(testTree.right.traitLocation)),
|
|
19
|
-
],
|
|
20
|
-
expectedSize: 1163,
|
|
21
|
-
description: 'when inserting a node',
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
edits: (testTree) => {
|
|
25
|
-
const edits = [];
|
|
26
|
-
for (let i = 0; i < 50; i++) {
|
|
27
|
-
edits.push(Change.insertTree(testTree.buildLeaf(), StablePlace.atEndOf(testTree.right.traitLocation)));
|
|
28
|
-
}
|
|
29
|
-
return edits;
|
|
30
|
-
},
|
|
31
|
-
expectedSize: 12924,
|
|
32
|
-
description: 'with 50 inserts',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
edits: (testTree) => {
|
|
36
|
-
const node = testTree.buildLeaf(testTree.generateNodeId());
|
|
37
|
-
return [
|
|
38
|
-
Change.insertTree(testTree.buildLeaf(), StablePlace.atEndOf(testTree.right.traitLocation)),
|
|
39
|
-
[Change.setPayload(node.identifier, 10)],
|
|
40
|
-
];
|
|
41
|
-
},
|
|
42
|
-
expectedSize: 1302,
|
|
43
|
-
description: 'when inserting and setting a node',
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
edits: (testTree) => {
|
|
47
|
-
const node = testTree.buildLeaf(testTree.generateNodeId());
|
|
48
|
-
return [
|
|
49
|
-
Change.insertTree(node, StablePlace.atEndOf(testTree.right.traitLocation)),
|
|
50
|
-
[Change.delete(StableRange.only(node))],
|
|
51
|
-
];
|
|
52
|
-
},
|
|
53
|
-
expectedSize: 1355,
|
|
54
|
-
description: 'when inserting and deleting a node',
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
edits: (testTree) => [
|
|
58
|
-
Change.insertTree(testTree.buildLeaf(), StablePlace.atEndOf(testTree.right.traitLocation)),
|
|
59
|
-
],
|
|
60
|
-
expectedSize: 1355,
|
|
61
|
-
description: 'when inserting and reverting a node',
|
|
62
|
-
revertEdits: true,
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
edits: (testTree) => [
|
|
66
|
-
Change.insertTree(makeLargeTestTree(testTree), StablePlace.atStartOf(testTree.right.traitLocation)),
|
|
67
|
-
],
|
|
68
|
-
expectedSize: 77067,
|
|
69
|
-
description: 'when inserting a large tree',
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
edits: (testTree) => {
|
|
73
|
-
const largeTree = makeLargeTestTree(testTree);
|
|
74
|
-
return [
|
|
75
|
-
Change.insertTree(largeTree, StablePlace.atStartOf(testTree.right.traitLocation)),
|
|
76
|
-
Change.move(StableRange.only(largeTree), StablePlace.atEndOf(testTree.left.traitLocation)),
|
|
77
|
-
];
|
|
78
|
-
},
|
|
79
|
-
expectedSize: 77375,
|
|
80
|
-
description: 'when inserting and moving a large tree',
|
|
81
|
-
},
|
|
82
|
-
];
|
|
83
|
-
/**
|
|
84
|
-
* Runs a test suite for summaries on `SharedTree` that verifies their sizes do not exceed the defined limits.
|
|
85
|
-
* This suite can be used to test other implementations that aim to fulfill `SharedTree`'s contract.
|
|
86
|
-
*/
|
|
87
|
-
export function runSummarySizeTests(title, setUpLocalServerTestSharedTree) {
|
|
88
|
-
describe(title, () => {
|
|
89
|
-
const setupEditId = '9406d301-7449-48a5-b2ea-9be637b0c6e4';
|
|
90
|
-
let tree;
|
|
91
|
-
let testTree;
|
|
92
|
-
let testObjectProvider;
|
|
93
|
-
// Resets the tree before each test
|
|
94
|
-
beforeEach(async () => {
|
|
95
|
-
const testingComponents = await setUpLocalServerTestSharedTree({
|
|
96
|
-
setupEditId,
|
|
97
|
-
});
|
|
98
|
-
tree = testingComponents.tree;
|
|
99
|
-
testTree = setUpTestTree(tree);
|
|
100
|
-
testObjectProvider = testingComponents.testObjectProvider;
|
|
101
|
-
});
|
|
102
|
-
async function checkSummarySize(changes, expectedSummarySize, revertEdits = false) {
|
|
103
|
-
const edits = changes.map((e) => tree.applyEdit(...e));
|
|
104
|
-
if (revertEdits) {
|
|
105
|
-
for (let i = changes.length - 1; i >= 0; i--) {
|
|
106
|
-
const editIndex = tree.edits.getIndexOfId(edits[i].id);
|
|
107
|
-
const edit = tree.edits.tryGetEditAtIndex(editIndex) ??
|
|
108
|
-
fail('edit not found');
|
|
109
|
-
const reverted = revert(edit.changes, tree.logViewer.getRevisionViewInMemory(editIndex));
|
|
110
|
-
if (reverted !== undefined) {
|
|
111
|
-
tree.applyEditInternal(reverted);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
// Wait for the ops to to be submitted and processed across the containers.
|
|
116
|
-
await testObjectProvider.ensureSynchronized();
|
|
117
|
-
const summary = tree.saveSerializedSummary();
|
|
118
|
-
const summarySize = IsoBuffer.from(summary).byteLength;
|
|
119
|
-
// TODO: make lte when 0.1.1 is settled
|
|
120
|
-
expect(summarySize).to.equal(expectedSummarySize);
|
|
121
|
-
}
|
|
122
|
-
for (const { edits, expectedSize, description, revertEdits } of summarySizeTests) {
|
|
123
|
-
it(`does not exceed ${expectedSize} ${description}`, async () => {
|
|
124
|
-
await checkSummarySize(edits(testTree), expectedSize, revertEdits);
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
function makeLargeTestTree(testTree, nodesPerTrait = 10, traitsPerLevel = 2, levels = 2) {
|
|
130
|
-
const specialSession = '9f858704-89f6-4923-abf3-14fc986e717f';
|
|
131
|
-
// ensure uuids for traits and definitions are stable
|
|
132
|
-
const compressor = new IdCompressor(specialSession, 0);
|
|
133
|
-
const uuidv4 = () => compressor.decompress(compressor.generateCompressedId());
|
|
134
|
-
const definition = uuidv4();
|
|
135
|
-
const traitLabels = [];
|
|
136
|
-
for (let i = 0; i < traitsPerLevel; i++) {
|
|
137
|
-
traitLabels.push(uuidv4());
|
|
138
|
-
}
|
|
139
|
-
return {
|
|
140
|
-
definition,
|
|
141
|
-
identifier: testTree.generateNodeId(),
|
|
142
|
-
traits: generateTraits(testTree, definition, traitLabels, nodesPerTrait, levels),
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
function generateTraits(testTree, definition, traitLabels, nodesPerTrait, totalLevels, level = 0) {
|
|
146
|
-
const traits = {};
|
|
147
|
-
traitLabels.forEach((label) => {
|
|
148
|
-
traits[label] = Array.from(Array(nodesPerTrait).keys()).map(() => {
|
|
149
|
-
return {
|
|
150
|
-
definition,
|
|
151
|
-
identifier: testTree.generateNodeId(),
|
|
152
|
-
traits: level < totalLevels
|
|
153
|
-
? generateTraits(testTree, definition, traitLabels, nodesPerTrait, totalLevels, level + 1)
|
|
154
|
-
: {},
|
|
155
|
-
};
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
return traits;
|
|
159
|
-
}
|
|
160
|
-
//# sourceMappingURL=SummarySizeTests.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SummarySizeTests.js","sourceRoot":"","sources":["../../../src/test/utilities/SummarySizeTests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxE,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,EAGN,aAAa,GACb,MAAM,oBAAoB,CAAC;AAgB5B;;GAEG;AACH,MAAM,gBAAgB,GAA2B;IAChD;QACC,KAAK,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC;YACpB,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,WAAW,CAAC,OAAO,CAAC,QAAQ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AQ,CAAC,cAAc,EAAE;QACrC,MAAM,EAAE,cAAc,CAAC,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,CAAC;KAChF,CAAC;AACH,CAAC;AAED,SAAS,cAAc,CACtB,QAAkB,EAClB,UAAsB,EACtB,WAAyB,EACzB,aAAqB,EACrB,WAAmB,EACnB,KAAK,GAAG,CAAC;IAET,MAAM,MAAM,GAAG,EAAE,CAAC;IAElB,WAAW,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC7B,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE;YAChE,OAAO;gBACN,UAAU;gBACV,UAAU,EAAE,QAAQ,CAAC,cAAc,EAAE;gBACrC,MAAM,EACL,KAAK,GAAG,WAAW;oBAClB,CAAC,CAAC,cAAc,CAAC,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,KAAK,GAAG,CAAC,CAAC;oBAC1F,CAAC,CAAC,EAAE;aACN,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AACf,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IsoBuffer } from '@fluid-internal/client-utils';\nimport { TestObjectProvider } from '@fluidframework/test-utils';\nimport { expect } from 'chai';\nimport { fail } from '../../Common.js';\nimport { Definition, EditId, SessionId, TraitLabel } from '../../Identifiers.js';\nimport { Change, StablePlace, StableRange } from '../../ChangeTypes.js';\nimport { SharedTree } from '../../SharedTree.js';\nimport { ChangeInternal, ChangeNode, Edit, TraitMap } from '../../persisted-types/index.js';\nimport { revert } from '../../HistoryEditFactory.js';\nimport { IdCompressor } from '../../id-compressor/index.js';\nimport { TestTree } from './TestNode.js';\nimport {\n\tLocalServerSharedTreeTestingComponents,\n\tLocalServerSharedTreeTestingOptions,\n\tsetUpTestTree,\n} from './TestUtilities.js';\n\n/**\n * An entry into the summarySizeTests list.\n */\ninterface SummarySizeTestEntry {\n\t/** Helper to obtain the list of edits to apply to the SharedTree. */\n\tedits: (testTree: TestTree) => Change[][];\n\t/** Expected size of the summary of the SharedTree after applying the `edits`. */\n\texpectedSize: number;\n\t/** Description for the test and the edits applied. */\n\tdescription: string;\n\t/** Flag to determine whether to revert the applied edits or not. */\n\trevertEdits?: boolean;\n}\n\n/**\n * Summary size tests where `edits` are applied and checked against the `expectedSize`.\n */\nconst summarySizeTests: SummarySizeTestEntry[] = [\n\t{\n\t\tedits: (testTree) => [\n\t\t\tChange.insertTree(testTree.buildLeaf(), StablePlace.atEndOf(testTree.right.traitLocation)),\n\t\t],\n\t\texpectedSize: 1163,\n\t\tdescription: 'when inserting a node',\n\t},\n\t{\n\t\tedits: (testTree) => {\n\t\t\tconst edits: Change[][] = [];\n\t\t\tfor (let i = 0; i < 50; i++) {\n\t\t\t\tedits.push(Change.insertTree(testTree.buildLeaf(), StablePlace.atEndOf(testTree.right.traitLocation)));\n\t\t\t}\n\t\t\treturn edits;\n\t\t},\n\t\texpectedSize: 12924,\n\t\tdescription: 'with 50 inserts',\n\t},\n\t{\n\t\tedits: (testTree) => {\n\t\t\tconst node = testTree.buildLeaf(testTree.generateNodeId());\n\t\t\treturn [\n\t\t\t\tChange.insertTree(testTree.buildLeaf(), StablePlace.atEndOf(testTree.right.traitLocation)),\n\t\t\t\t[Change.setPayload(node.identifier, 10)],\n\t\t\t];\n\t\t},\n\t\texpectedSize: 1302,\n\t\tdescription: 'when inserting and setting a node',\n\t},\n\t{\n\t\tedits: (testTree) => {\n\t\t\tconst node = testTree.buildLeaf(testTree.generateNodeId());\n\t\t\treturn [\n\t\t\t\tChange.insertTree(node, StablePlace.atEndOf(testTree.right.traitLocation)),\n\t\t\t\t[Change.delete(StableRange.only(node))],\n\t\t\t];\n\t\t},\n\t\texpectedSize: 1355,\n\t\tdescription: 'when inserting and deleting a node',\n\t},\n\t{\n\t\tedits: (testTree) => [\n\t\t\tChange.insertTree(testTree.buildLeaf(), StablePlace.atEndOf(testTree.right.traitLocation)),\n\t\t],\n\t\texpectedSize: 1355,\n\t\tdescription: 'when inserting and reverting a node',\n\t\trevertEdits: true,\n\t},\n\t{\n\t\tedits: (testTree) => [\n\t\t\tChange.insertTree(makeLargeTestTree(testTree), StablePlace.atStartOf(testTree.right.traitLocation)),\n\t\t],\n\t\texpectedSize: 77067,\n\t\tdescription: 'when inserting a large tree',\n\t},\n\t{\n\t\tedits: (testTree) => {\n\t\t\tconst largeTree = makeLargeTestTree(testTree);\n\t\t\treturn [\n\t\t\t\tChange.insertTree(largeTree, StablePlace.atStartOf(testTree.right.traitLocation)),\n\t\t\t\tChange.move(StableRange.only(largeTree), StablePlace.atEndOf(testTree.left.traitLocation)),\n\t\t\t];\n\t\t},\n\t\texpectedSize: 77375,\n\t\tdescription: 'when inserting and moving a large tree',\n\t},\n];\n\n/**\n * Runs a test suite for summaries on `SharedTree` that verifies their sizes do not exceed the defined limits.\n * This suite can be used to test other implementations that aim to fulfill `SharedTree`'s contract.\n */\nexport function runSummarySizeTests(\n\ttitle: string,\n\tsetUpLocalServerTestSharedTree: (\n\t\toptions: LocalServerSharedTreeTestingOptions\n\t) => Promise<LocalServerSharedTreeTestingComponents>\n) {\n\tdescribe(title, () => {\n\t\tconst setupEditId = '9406d301-7449-48a5-b2ea-9be637b0c6e4' as EditId;\n\n\t\tlet tree: SharedTree;\n\t\tlet testTree: TestTree;\n\t\tlet testObjectProvider: TestObjectProvider;\n\n\t\t// Resets the tree before each test\n\t\tbeforeEach(async () => {\n\t\t\tconst testingComponents = await setUpLocalServerTestSharedTree({\n\t\t\t\tsetupEditId,\n\t\t\t});\n\t\t\ttree = testingComponents.tree;\n\t\t\ttestTree = setUpTestTree(tree);\n\t\t\ttestObjectProvider = testingComponents.testObjectProvider;\n\t\t});\n\n\t\tasync function checkSummarySize(\n\t\t\tchanges: Change[][],\n\t\t\texpectedSummarySize: number,\n\t\t\trevertEdits = false\n\t\t): Promise<void> {\n\t\t\tconst edits = changes.map((e) => tree.applyEdit(...e));\n\n\t\t\tif (revertEdits) {\n\t\t\t\tfor (let i = changes.length - 1; i >= 0; i--) {\n\t\t\t\t\tconst editIndex = tree.edits.getIndexOfId(edits[i].id);\n\t\t\t\t\tconst edit =\n\t\t\t\t\t\t(tree.edits.tryGetEditAtIndex(editIndex) as unknown as Edit<ChangeInternal>) ??\n\t\t\t\t\t\tfail('edit not found');\n\t\t\t\t\tconst reverted = revert(edit.changes, tree.logViewer.getRevisionViewInMemory(editIndex));\n\t\t\t\t\tif (reverted !== undefined) {\n\t\t\t\t\t\ttree.applyEditInternal(reverted);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Wait for the ops to to be submitted and processed across the containers.\n\t\t\tawait testObjectProvider.ensureSynchronized();\n\n\t\t\tconst summary = tree.saveSerializedSummary();\n\t\t\tconst summarySize = IsoBuffer.from(summary).byteLength;\n\n\t\t\t// TODO: make lte when 0.1.1 is settled\n\t\t\texpect(summarySize).to.equal(expectedSummarySize);\n\t\t}\n\n\t\tfor (const { edits, expectedSize, description, revertEdits } of summarySizeTests) {\n\t\t\tit(`does not exceed ${expectedSize} ${description}`, async () => {\n\t\t\t\tawait checkSummarySize(edits(testTree), expectedSize, revertEdits);\n\t\t\t});\n\t\t}\n\t});\n}\n\nfunction makeLargeTestTree(testTree: TestTree, nodesPerTrait = 10, traitsPerLevel = 2, levels = 2): ChangeNode {\n\tconst specialSession = '9f858704-89f6-4923-abf3-14fc986e717f' as SessionId;\n\t// ensure uuids for traits and definitions are stable\n\tconst compressor = new IdCompressor(specialSession, 0);\n\tconst uuidv4 = (): string => compressor.decompress(compressor.generateCompressedId());\n\tconst definition = uuidv4() as Definition;\n\n\tconst traitLabels: TraitLabel[] = [];\n\tfor (let i = 0; i < traitsPerLevel; i++) {\n\t\ttraitLabels.push(uuidv4() as TraitLabel);\n\t}\n\n\treturn {\n\t\tdefinition,\n\t\tidentifier: testTree.generateNodeId(),\n\t\ttraits: generateTraits(testTree, definition, traitLabels, nodesPerTrait, levels),\n\t};\n}\n\nfunction generateTraits(\n\ttestTree: TestTree,\n\tdefinition: Definition,\n\ttraitLabels: TraitLabel[],\n\tnodesPerTrait: number,\n\ttotalLevels: number,\n\tlevel = 0\n): TraitMap<ChangeNode> {\n\tconst traits = {};\n\n\ttraitLabels.forEach((label) => {\n\t\ttraits[label] = Array.from(Array(nodesPerTrait).keys()).map(() => {\n\t\t\treturn {\n\t\t\t\tdefinition,\n\t\t\t\tidentifier: testTree.generateNodeId(),\n\t\t\t\ttraits:\n\t\t\t\t\tlevel < totalLevels\n\t\t\t\t\t\t? generateTraits(testTree, definition, traitLabels, nodesPerTrait, totalLevels, level + 1)\n\t\t\t\t\t\t: {},\n\t\t\t};\n\t\t});\n\t});\n\n\treturn traits;\n}\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Check if the given value is defined using mocha's `expect`. Return the defined value;
|
|
7
|
-
*/
|
|
8
|
-
export declare function expectDefined<T>(value: T | undefined): T;
|
|
9
|
-
/**
|
|
10
|
-
* Expects `condition` and applies a type assertion.
|
|
11
|
-
*/
|
|
12
|
-
export declare function expectAssert(condition: unknown, message?: string): asserts condition;
|
|
13
|
-
//# sourceMappingURL=TestCommon.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestCommon.d.ts","sourceRoot":"","sources":["../../../src/test/utilities/TestCommon.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,SAAS,GAAG,CAAC,CAGxD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAEpF"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { expect } from 'chai';
|
|
6
|
-
/**
|
|
7
|
-
* Check if the given value is defined using mocha's `expect`. Return the defined value;
|
|
8
|
-
*/
|
|
9
|
-
export function expectDefined(value) {
|
|
10
|
-
expect(value).to.be.not.undefined;
|
|
11
|
-
return value;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Expects `condition` and applies a type assertion.
|
|
15
|
-
*/
|
|
16
|
-
export function expectAssert(condition, message) {
|
|
17
|
-
expect(condition, message);
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=TestCommon.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestCommon.js","sourceRoot":"","sources":["../../../src/test/utilities/TestCommon.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B;;GAEG;AACH,MAAM,UAAU,aAAa,CAAI,KAAoB;IACpD,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC;IAClC,OAAO,KAAU,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,SAAkB,EAAE,OAAgB;IAChE,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { expect } from 'chai';\n\n/**\n * Check if the given value is defined using mocha's `expect`. Return the defined value;\n */\nexport function expectDefined<T>(value: T | undefined): T {\n\texpect(value).to.be.not.undefined;\n\treturn value as T;\n}\n\n/**\n * Expects `condition` and applies a type assertion.\n */\nexport function expectAssert(condition: unknown, message?: string): asserts condition {\n\texpect(condition, message);\n}\n"]}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { BuildTreeNode } from '../../ChangeTypes.js';
|
|
6
|
-
import { Definition, NodeId, OpSpaceNodeId, SessionId, StableNodeId, TraitLabel } from '../../Identifiers.js';
|
|
7
|
-
import { NodeIdContext, NodeIdConverter, NodeIdNormalizer } from '../../NodeIdUtilities.js';
|
|
8
|
-
import { BuildNodeInternal, ChangeNode, Payload, TraitLocationInternal_0_0_2, TraitMap, TreeNode } from '../../persisted-types/index.js';
|
|
9
|
-
import { RevisionView } from '../../RevisionView.js';
|
|
10
|
-
import { TraitLocation } from '../../TreeView.js';
|
|
11
|
-
/** A legacy format of a `TestNode` */
|
|
12
|
-
export type TestNode_0_0_2 = TreeNode<TestNode_0_0_2, StableNodeId>;
|
|
13
|
-
/**
|
|
14
|
-
* A node with no children
|
|
15
|
-
*/
|
|
16
|
-
export type LeafNode<T> = Omit<T, 'traits'> & {
|
|
17
|
-
traits: Record<string, never>;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Test extension of {@link TraitLocation} which can be converted to stable or legacy formats
|
|
21
|
-
*/
|
|
22
|
-
export interface TestTraitLocation extends TraitLocation {
|
|
23
|
-
stable: TraitLocationInternal_0_0_2;
|
|
24
|
-
/** Translate this location into the equivalent location in another ID context */
|
|
25
|
-
translate(idConverter: NodeIdConverter): TestTraitLocation;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* An object containing useful properties for analyzing a node within a test context.
|
|
29
|
-
*/
|
|
30
|
-
export interface TestNode extends TreeNode<TestNode, NodeId> {
|
|
31
|
-
/** The label of the trait under which this node resides */
|
|
32
|
-
traitLabel: TraitLabel;
|
|
33
|
-
/** The trait location at which this node resides */
|
|
34
|
-
traitLocation: TestTraitLocation;
|
|
35
|
-
/** A revision view of this node */
|
|
36
|
-
view: RevisionView;
|
|
37
|
-
/** A version of this tree with stable IDs */
|
|
38
|
-
stable: TestNode_0_0_2;
|
|
39
|
-
/** Translate this node's ID into the equivalent ID in another ID context */
|
|
40
|
-
translateId(idConverter: NodeIdConverter): NodeId;
|
|
41
|
-
/** Express this tree as a ChangeNode */
|
|
42
|
-
toChangeNode(): ChangeNode;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* A small tree of `TestNode`s consisting of a root/parent node, a "left" child and a "right" child. This is a useful tree for initializing
|
|
46
|
-
* tests as it makes it ergonomic to retrieve various properties of the tree. Note that it only represents the initial state of the tree,
|
|
47
|
-
* it does not update even if the SharedTree that it was the initial state for is mutated.
|
|
48
|
-
*/
|
|
49
|
-
export interface TestTree extends TestNode, NodeIdContext, NodeIdNormalizer<OpSpaceNodeId> {
|
|
50
|
-
/** The left child node */
|
|
51
|
-
left: TestNode;
|
|
52
|
-
/** The right child node */
|
|
53
|
-
right: TestNode;
|
|
54
|
-
/** Create an arbitrary unparented node with the given payload, if specified */
|
|
55
|
-
buildLeaf(id?: undefined, payload?: Payload): LeafNode<BuildTreeNode>;
|
|
56
|
-
/** Create an arbitrary unparented node with the given identifier and payload, if specified */
|
|
57
|
-
buildLeaf(id: NodeId, payload?: Payload): LeafNode<ChangeNode>;
|
|
58
|
-
/**
|
|
59
|
-
* Generates a leaf node for use in internal build changes.
|
|
60
|
-
* If no `id` is explicitly provided, one will be generated.
|
|
61
|
-
* @param id - Explicit ID to use as the new node's identifier. If not provided, one will be generated.
|
|
62
|
-
*/
|
|
63
|
-
buildLeafInternal(id?: NodeId, payload?: Payload): LeafNode<TreeNode<BuildNodeInternal, NodeId>>;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* A TestTree for general use within the shared-tree package. The nodes in every `SimpleTestTree` will have unique identifiers - i.e. two
|
|
67
|
-
* different instances of `SimpleTestTree` are never equivalent.
|
|
68
|
-
*/
|
|
69
|
-
export declare class SimpleTestTree implements TestTree {
|
|
70
|
-
private readonly nodeIdContext;
|
|
71
|
-
private readonly nodeIdNormalizer;
|
|
72
|
-
static readonly definition: Definition;
|
|
73
|
-
static readonly traitLabel: TraitLabel;
|
|
74
|
-
static readonly leftTraitLabel: TraitLabel;
|
|
75
|
-
static readonly rightTraitLabel: TraitLabel;
|
|
76
|
-
private readonly root;
|
|
77
|
-
readonly left: TestNode;
|
|
78
|
-
readonly right: TestNode;
|
|
79
|
-
readonly expensiveValidation: any;
|
|
80
|
-
constructor(nodeIdContext: NodeIdContext, nodeIdNormalizer: NodeIdNormalizer<OpSpaceNodeId>, expensiveValidation?: boolean);
|
|
81
|
-
get definition(): Definition;
|
|
82
|
-
get identifier(): NodeId;
|
|
83
|
-
get traits(): TraitMap<TestNode>;
|
|
84
|
-
get traitLabel(): TraitLabel;
|
|
85
|
-
get traitLocation(): TestTraitLocation;
|
|
86
|
-
get view(): RevisionView;
|
|
87
|
-
get stable(): TestNode_0_0_2;
|
|
88
|
-
translateId(idConverter: NodeIdConverter): NodeId;
|
|
89
|
-
toChangeNode(): ChangeNode;
|
|
90
|
-
buildLeaf(id?: undefined, payload?: Payload): LeafNode<BuildTreeNode>;
|
|
91
|
-
buildLeaf(id: NodeId, payload?: Payload): LeafNode<ChangeNode>;
|
|
92
|
-
buildLeafInternal(id?: NodeId, payload?: Payload): LeafNode<TreeNode<BuildNodeInternal, NodeId>>;
|
|
93
|
-
generateNodeId(override?: string): NodeId;
|
|
94
|
-
convertToStableNodeId(id: NodeId): StableNodeId;
|
|
95
|
-
tryConvertToStableNodeId(id: NodeId): StableNodeId | undefined;
|
|
96
|
-
convertToNodeId(id: StableNodeId): NodeId;
|
|
97
|
-
tryConvertToNodeId(id: StableNodeId): NodeId | undefined;
|
|
98
|
-
get localSessionId(): SessionId;
|
|
99
|
-
normalizeToOpSpace(id: NodeId): OpSpaceNodeId;
|
|
100
|
-
normalizeToSessionSpace(id: OpSpaceNodeId, sessionId: SessionId): NodeId;
|
|
101
|
-
}
|
|
102
|
-
/** A TestTree which resets before each test */
|
|
103
|
-
export declare class RefreshingTestTree<T extends TestTree> implements TestTree {
|
|
104
|
-
private _testTree?;
|
|
105
|
-
constructor(createTestTree: () => T, fn?: (testTree: T) => void);
|
|
106
|
-
private get testTree();
|
|
107
|
-
get left(): TestNode;
|
|
108
|
-
get right(): TestNode;
|
|
109
|
-
get definition(): Definition;
|
|
110
|
-
get identifier(): NodeId;
|
|
111
|
-
get traits(): TraitMap<TestNode>;
|
|
112
|
-
get traitLabel(): TraitLabel;
|
|
113
|
-
get traitLocation(): TestTraitLocation;
|
|
114
|
-
get view(): RevisionView;
|
|
115
|
-
get stable(): TestNode_0_0_2;
|
|
116
|
-
translateId(idConverter: NodeIdConverter): NodeId;
|
|
117
|
-
toChangeNode(): ChangeNode;
|
|
118
|
-
buildLeaf(id?: undefined, payload?: Payload): LeafNode<BuildTreeNode>;
|
|
119
|
-
buildLeaf(id: NodeId, payload?: Payload): LeafNode<ChangeNode>;
|
|
120
|
-
buildLeafInternal(id?: NodeId, payload?: Payload): LeafNode<TreeNode<BuildNodeInternal, NodeId>>;
|
|
121
|
-
generateNodeId(override?: string): NodeId;
|
|
122
|
-
convertToStableNodeId(id: NodeId): StableNodeId;
|
|
123
|
-
tryConvertToStableNodeId(id: NodeId): StableNodeId | undefined;
|
|
124
|
-
convertToNodeId(id: StableNodeId): NodeId;
|
|
125
|
-
tryConvertToNodeId(id: StableNodeId): NodeId | undefined;
|
|
126
|
-
get localSessionId(): SessionId;
|
|
127
|
-
normalizeToOpSpace(id: NodeId): OpSpaceNodeId;
|
|
128
|
-
normalizeToSessionSpace(id: OpSpaceNodeId, sessionId: SessionId): NodeId;
|
|
129
|
-
}
|
|
130
|
-
/** Create a new node with an automatically generated ID and the given payload */
|
|
131
|
-
export declare function buildLeaf(id?: undefined, payload?: Payload): LeafNode<BuildTreeNode>;
|
|
132
|
-
/** Create a new node with the given ID and payload */
|
|
133
|
-
export declare function buildLeaf(id: NodeId, payload?: Payload): LeafNode<ChangeNode>;
|
|
134
|
-
/**
|
|
135
|
-
* Generates a leaf {@link ChangeNode}.
|
|
136
|
-
* If no `id` is explicitly provided, one will be generated.
|
|
137
|
-
* @param id - Explicit ID to use as the new node's identifier. If not provided, one will be generated.
|
|
138
|
-
*/
|
|
139
|
-
export declare function buildLeafInternal(nodeIdContext: NodeIdContext, id?: NodeId, payload?: Payload): LeafNode<TreeNode<BuildNodeInternal, NodeId>>;
|
|
140
|
-
//# sourceMappingURL=TestNode.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestNode.d.ts","sourceRoot":"","sources":["../../../src/test/utilities/TestNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAIrD,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAE9G,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5F,OAAO,EACN,iBAAiB,EACjB,UAAU,EACV,OAAO,EAEP,2BAA2B,EAC3B,QAAQ,EACR,QAAQ,EACR,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,sCAAsC;AACtC,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;AAEpE;;GAEG;AACH,MAAM,MAAM,QAAQ,CAAC,CAA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