mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-11 07:59:08 +02:00
fix tests
This commit is contained in:
@@ -460,7 +460,7 @@ func (s *SqlStore) SaveGroups(ctx context.Context, lockStrength LockingStrength,
|
||||
}
|
||||
|
||||
return s.db.Transaction(func(tx *gorm.DB) error {
|
||||
result := tx.Session(&gorm.Session{FullSaveAssociations: true}).
|
||||
result := tx.
|
||||
Clauses(
|
||||
clause.Locking{Strength: string(lockStrength)},
|
||||
clause.OnConflict{
|
||||
@@ -475,8 +475,6 @@ func (s *SqlStore) SaveGroups(ctx context.Context, lockStrength LockingStrength,
|
||||
}
|
||||
|
||||
for _, g := range groups {
|
||||
g.StoreGroupPeers()
|
||||
|
||||
if err := tx.Model(&g).
|
||||
Association("GroupPeers").
|
||||
Replace(g.GroupPeers); err != nil {
|
||||
|
||||
@@ -1371,12 +1371,11 @@ func TestSqlStore_SaveGroups(t *testing.T) {
|
||||
GroupPeers: []types.GroupPeer{},
|
||||
},
|
||||
{
|
||||
ID: "group-2",
|
||||
AccountID: accountID,
|
||||
Issued: "integration",
|
||||
Peers: []string{"peer3", "peer4"},
|
||||
Resources: []types.Resource{},
|
||||
GroupPeers: []types.GroupPeer{},
|
||||
ID: "group-2",
|
||||
AccountID: accountID,
|
||||
Issued: "integration",
|
||||
Peers: []string{"peer3", "peer4"},
|
||||
Resources: []types.Resource{},
|
||||
},
|
||||
}
|
||||
err = store.SaveGroups(context.Background(), LockingStrengthUpdate, accountID, groups)
|
||||
|
||||
Reference in New Issue
Block a user