Skip to content

Commit 7be7a17

Browse files
committed
update
1 parent 7de4267 commit 7be7a17

File tree

12 files changed

+446
-204
lines changed

12 files changed

+446
-204
lines changed

pkg/datastore/transaction_rpc.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func (d *Datastore) replaceIntent(ctx context.Context, transaction *types.Transa
9797
// create a new TreeContext
9898
tc := tree.NewTreeContext(treeSCC, d.schemaClient, d.Name())
9999
// refresh the Cache content of the treeCacheSchemaClient
100-
tc.GetTreeSchemaCacheClient().RefreshCaches(ctx)
100+
tc.GetTreeCacheClient().RefreshCaches(ctx)
101101

102102
// create a new TreeRoot to collect validate and hand to SBI.Set()
103103
root, err := tree.NewTreeRoot(ctx, tc)
@@ -109,7 +109,7 @@ func (d *Datastore) replaceIntent(ctx context.Context, transaction *types.Transa
109109
tc.SetActualOwner(tree.ReplaceIntentName)
110110

111111
// store the actual / old running in the transaction
112-
runningUpds, err := tc.GetTreeSchemaCacheClient().ReadRunningFull(ctx)
112+
runningUpds, err := tc.GetTreeCacheClient().ReadRunningFull(ctx)
113113
transaction.GetOldRunning().AddUpdates(runningUpds)
114114

115115
// creat a InsertFlags struct with the New flag set.
@@ -175,7 +175,7 @@ func (d *Datastore) lowlevelTransactionSet(ctx context.Context, transaction *typ
175175
// create a new TreeContext
176176
tc := tree.NewTreeContext(treeSCC, d.schemaClient, d.Name())
177177
// refresh the SchemaClientCache
178-
tc.GetTreeSchemaCacheClient().RefreshCaches(ctx)
178+
tc.GetTreeCacheClient().RefreshCaches(ctx)
179179

180180
// creat a new TreeRoot
181181
root, err := tree.NewTreeRoot(ctx, tc)

pkg/datastore/tree_operation_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,10 @@ func TestDatastore_populateTree(t *testing.T) {
695695
cache.NewUpdate([]string{"choices", "case1", "case-elem", "elem"}, testhelper.GetStringTvProto(t, "case1-content"), prio15, owner1, 0),
696696
cache.NewUpdate([]string{"choices", "case1", "log"}, TypedValueFalse, prio15, owner1, 0),
697697
},
698+
runningStoreUpdates: []*cache.Update{
699+
cache.NewUpdate([]string{"choices", "case1", "case-elem", "elem"}, testhelper.GetStringTvProto(t, "case1-content"), tree.RunningValuesPrio, tree.RunningIntentName, 0),
700+
cache.NewUpdate([]string{"choices", "case1", "log"}, TypedValueFalse, tree.RunningValuesPrio, tree.RunningIntentName, 0),
701+
},
698702
},
699703
{
700704
name: "ChoiceCase - old highes case",
@@ -724,13 +728,18 @@ func TestDatastore_populateTree(t *testing.T) {
724728
cache.NewUpdate([]string{"choices", "case1", "case-elem", "elem"}, testhelper.GetStringTvProto(t, "case1-content"), prio5, owner1, 0),
725729
cache.NewUpdate([]string{"choices", "case1", "log"}, TypedValueFalse, prio5, owner1, 0),
726730
},
731+
runningStoreUpdates: []*cache.Update{
732+
cache.NewUpdate([]string{"choices", "case1", "case-elem", "elem"}, testhelper.GetStringTvProto(t, "case1-content"), tree.RunningValuesPrio, tree.RunningIntentName, 0),
733+
cache.NewUpdate([]string{"choices", "case1", "log"}, TypedValueFalse, tree.RunningValuesPrio, tree.RunningIntentName, 0),
734+
},
727735
},
728736
}
729737

730738
for _, tt := range tests {
731739
t.Run(tt.name, func(t *testing.T) {
732740
// create a gomock controller
733741
controller := gomock.NewController(t)
742+
defer controller.Finish()
734743

735744
// create a cache client mock
736745
cacheClient := mockcacheclient.NewMockClient(controller)
@@ -820,8 +829,9 @@ func TestDatastore_populateTree(t *testing.T) {
820829
if err != nil {
821830
t.Error(err)
822831
}
823-
832+
fmt.Println(root.String())
824833
root.FinishInsertionPhase(ctx)
834+
fmt.Println(root.String())
825835

826836
validationResult := root.Validate(ctx, false)
827837

0 commit comments

Comments
 (0)