Skip to content

Commit

Permalink
test: fix compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
zepatrik committed Feb 7, 2022
1 parent 4f112a4 commit 1d16f31
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/migrate/migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestMigrate(t *testing.T) {
newCmd := func(ctx context.Context, persistentArgs ...string) *cmdx.CommandExecuter {
return &cmdx.CommandExecuter{
New: func() *cobra.Command {
cmd := newMigrateCmd()
cmd := newMigrateCmd(nil)
configx.RegisterFlags(cmd.PersistentFlags())
return cmd
},
Expand Down
6 changes: 5 additions & 1 deletion cmd/namespace/migrate_legacy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"path"
"testing"

"github.com/spf13/cobra"

"github.com/ory/keto/internal/relationtuple"

"github.com/ory/x/cmdx"
Expand Down Expand Up @@ -50,7 +52,9 @@ func TestMigrateLegacy(t *testing.T) {
require.NoError(t, reg.Config(context.Background()).Set(config.KeyNamespaces, nspaces))

c := &cmdx.CommandExecuter{
New: NewMigrateLegacyCmd,
New: func() *cobra.Command {
return NewMigrateLegacyCmd(nil)
},
Ctx: context.WithValue(context.Background(), driver.RegistryContextKey, reg),
}

Expand Down
6 changes: 5 additions & 1 deletion cmd/serve_debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"testing"
"time"

"github.com/spf13/cobra"

"github.com/ory/x/cmdx"
"github.com/ory/x/configx"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -84,7 +86,9 @@ dsn: memory`)
require.NoError(b, os.Setenv(client.EnvWriteRemote, "127.0.0.1:4467"))

c := cmdx.CommandExecuter{
New: NewRootCmd,
New: func() *cobra.Command {
return NewRootCmd(nil)
},
Ctx: context.WithValue(rCtx, driver.RegistryContextKey, reg),
}
stdOut, stdErr := &bytes.Buffer{}, &bytes.Buffer{}
Expand Down
11 changes: 8 additions & 3 deletions internal/e2e/full_suit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import (
"testing"
"time"

"github.com/spf13/cobra"

"github.com/ory/keto/cmd"
cliclient "github.com/ory/keto/cmd/client"

"github.com/stretchr/testify/assert"

"github.com/ory/keto/internal/x/dbx"
Expand All @@ -16,12 +21,10 @@ import (

"github.com/stretchr/testify/require"

cliclient "github.com/ory/keto/cmd/client"
"github.com/ory/keto/internal/expand"

"github.com/ory/x/cmdx"

"github.com/ory/keto/cmd"
"github.com/ory/keto/internal/relationtuple"
)

Expand Down Expand Up @@ -63,7 +66,9 @@ func Test(t *testing.T) {
writeURL: "http://" + reg.Config(ctx).WriteAPIListenOn(),
},
&cliClient{c: &cmdx.CommandExecuter{
New: cmd.NewRootCmd,
New: func() *cobra.Command {
return cmd.NewRootCmd(nil)
},
Ctx: ctx,
PersistentArgs: []string{"--" + cliclient.FlagReadRemote, reg.Config(ctx).ReadAPIListenOn(), "--" + cliclient.FlagWriteRemote, reg.Config(ctx).WriteAPIListenOn(), "--" + cmdx.FlagFormat, string(cmdx.FormatJSON)},
}},
Expand Down

0 comments on commit 1d16f31

Please sign in to comment.