mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-09 15:45:12 +00:00
chore!: Introduce ZITADEL v3 (#9645)
This PR summarizes multiple changes specifically only available with ZITADEL v3: - feat: Web Keys management (https://github.com/zitadel/zitadel/pull/9526) - fix(cmd): ensure proper working of mirror (https://github.com/zitadel/zitadel/pull/9509) - feat(Authz): system user support for permission check v2 (https://github.com/zitadel/zitadel/pull/9640) - chore(license): change from Apache to AGPL (https://github.com/zitadel/zitadel/pull/9597) - feat(console): list v2 sessions (https://github.com/zitadel/zitadel/pull/9539) - fix(console): add loginV2 feature flag (https://github.com/zitadel/zitadel/pull/9682) - fix(feature flags): allow reading "own" flags (https://github.com/zitadel/zitadel/pull/9649) - feat(console): add Actions V2 UI (https://github.com/zitadel/zitadel/pull/9591) BREAKING CHANGE - feat(webkey): migrate to v2beta API (https://github.com/zitadel/zitadel/pull/9445) - chore!: remove CockroachDB Support (https://github.com/zitadel/zitadel/pull/9444) - feat(actions): migrate to v2beta API (https://github.com/zitadel/zitadel/pull/9489) --------- Co-authored-by: Livio Spring <[email protected]> Co-authored-by: Stefan Benz <[email protected]> Co-authored-by: Silvan <[email protected]> Co-authored-by: Ramon <[email protected]> Co-authored-by: Elio Bischof <[email protected]> Co-authored-by: Kenta Yamaguchi <[email protected]> Co-authored-by: Harsha Reddy <[email protected]> Co-authored-by: Livio Spring <[email protected]> Co-authored-by: Max Peintner <[email protected]> Co-authored-by: Iraq <[email protected]> Co-authored-by: Florian Forster <[email protected]> Co-authored-by: Tim Möhlmann <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Max Peintner <[email protected]>
This commit is contained in:
co-authored by
Livio Spring
Stefan Benz
Silvan
Ramon
Elio Bischof
Kenta Yamaguchi
Harsha Reddy
Livio Spring
Max Peintner
Iraq
Florian Forster
Tim Möhlmann
Copilot
Max Peintner
parent
d14a23ae7e
commit
07ce3b6905
@@ -2,7 +2,6 @@ package command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"testing"
|
||||
@@ -14,7 +13,6 @@ import (
|
||||
|
||||
"github.com/zitadel/zitadel/internal/eventstore"
|
||||
"github.com/zitadel/zitadel/internal/i18n"
|
||||
"github.com/zitadel/zitadel/internal/repository/permission"
|
||||
"github.com/zitadel/zitadel/internal/repository/user"
|
||||
)
|
||||
|
||||
@@ -31,93 +29,6 @@ func TestMain(m *testing.M) {
|
||||
os.Exit(m.Run())
|
||||
}
|
||||
|
||||
func TestCommands_pushChunked(t *testing.T) {
|
||||
aggregate := permission.NewAggregate("instanceID")
|
||||
cmds := make([]eventstore.Command, 100)
|
||||
for i := 0; i < 100; i++ {
|
||||
cmds[i] = permission.NewAddedEvent(context.Background(), aggregate, "role", fmt.Sprintf("permission%d", i))
|
||||
}
|
||||
type args struct {
|
||||
size uint16
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
eventstore func(*testing.T) *eventstore.Eventstore
|
||||
wantEvents int
|
||||
wantErr error
|
||||
}{
|
||||
{
|
||||
name: "push error",
|
||||
args: args{
|
||||
size: 100,
|
||||
},
|
||||
eventstore: expectEventstore(
|
||||
expectPushFailed(io.ErrClosedPipe, cmds...),
|
||||
),
|
||||
wantEvents: 0,
|
||||
wantErr: io.ErrClosedPipe,
|
||||
},
|
||||
{
|
||||
name: "single chunk",
|
||||
args: args{
|
||||
size: 100,
|
||||
},
|
||||
eventstore: expectEventstore(
|
||||
expectPush(cmds...),
|
||||
),
|
||||
wantEvents: len(cmds),
|
||||
},
|
||||
{
|
||||
name: "aligned chunks",
|
||||
args: args{
|
||||
size: 50,
|
||||
},
|
||||
eventstore: expectEventstore(
|
||||
expectPush(cmds[0:50]...),
|
||||
expectPush(cmds[50:100]...),
|
||||
),
|
||||
wantEvents: len(cmds),
|
||||
},
|
||||
{
|
||||
name: "odd chunks",
|
||||
args: args{
|
||||
size: 30,
|
||||
},
|
||||
eventstore: expectEventstore(
|
||||
expectPush(cmds[0:30]...),
|
||||
expectPush(cmds[30:60]...),
|
||||
expectPush(cmds[60:90]...),
|
||||
expectPush(cmds[90:100]...),
|
||||
),
|
||||
wantEvents: len(cmds),
|
||||
},
|
||||
{
|
||||
name: "partial error",
|
||||
args: args{
|
||||
size: 30,
|
||||
},
|
||||
eventstore: expectEventstore(
|
||||
expectPush(cmds[0:30]...),
|
||||
expectPush(cmds[30:60]...),
|
||||
expectPushFailed(io.ErrClosedPipe, cmds[60:90]...),
|
||||
),
|
||||
wantEvents: len(cmds[0:60]),
|
||||
wantErr: io.ErrClosedPipe,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
c := &Commands{
|
||||
eventstore: tt.eventstore(t),
|
||||
}
|
||||
gotEvents, err := c.pushChunked(context.Background(), tt.args.size, cmds...)
|
||||
require.ErrorIs(t, err, tt.wantErr)
|
||||
assert.Len(t, gotEvents, tt.wantEvents)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestCommands_asyncPush(t *testing.T) {
|
||||
// make sure the test terminates on deadlock
|
||||
background := context.Background()
|
||||
|
||||
Reference in New Issue
Block a user