mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-17 02:57:11 +02:00
postgres: fix record deletion (#3446)
This commit is contained in:
parent
270f8b4f2c
commit
1727d178ef
2 changed files with 22 additions and 2 deletions
pkg/storage/postgres
|
@ -12,6 +12,7 @@ import (
|
|||
"github.com/stretchr/testify/require"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/types/known/structpb"
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
|
||||
"github.com/pomerium/pomerium/internal/testutil"
|
||||
"github.com/pomerium/pomerium/pkg/grpc/databroker"
|
||||
|
@ -44,6 +45,21 @@ func TestBackend(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
})
|
||||
|
||||
t.Run("delete", func(t *testing.T) {
|
||||
serverVersion, err := backend.Put(ctx, []*databroker.Record{
|
||||
{
|
||||
Type: "test-1",
|
||||
Id: "r3",
|
||||
Data: protoutil.NewAny(protoutil.NewStructMap(map[string]*structpb.Value{
|
||||
"k1": protoutil.NewStructString("v1"),
|
||||
})),
|
||||
DeletedAt: timestamppb.Now(),
|
||||
},
|
||||
})
|
||||
assert.NotEqual(t, 0, serverVersion)
|
||||
assert.NoError(t, err)
|
||||
})
|
||||
|
||||
t.Run("capacity", func(t *testing.T) {
|
||||
err := backend.SetOptions(ctx, "capacity-test", &databroker.Options{
|
||||
Capacity: proto.Uint64(3),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue