MCPcopy
hub / github.com/ory/keto / Test

Function Test

internal/e2e/full_suit_test.go:52–133  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

50)
51
52func Test(t *testing.T) {
53 t.Parallel()
54 for _, dsn := range dbx.GetDSNs(t, false) {
55 t.Run(fmt.Sprintf("dsn=%s", dsn.Name), func(t *testing.T) {
56 t.Parallel()
57
58 ctx, reg, namespaceTestMgr, getAddr := newInitializedReg(t, dsn, nil)
59
60 closeServer := startServer(ctx, t, reg)
61 t.Cleanup(closeServer)
62
63 _, _, readAddr := getAddr(t, "read")
64 _, _, writeAddr := getAddr(t, "write")
65 _, _, oplAddr := getAddr(t, "opl")
66 _, _, metricsAddr := getAddr(t, "metrics")
67
68 // The test cases start here
69 // We execute every test with all clients available
70 for _, cl := range []client{
71 newGrpcClient(t, ctx,
72 readAddr,
73 writeAddr,
74 oplAddr,
75 ),
76 &restClient{
77 readURL: "http://" + readAddr,
78 writeURL: "http://" + writeAddr,
79 oplSyntaxURL: "http://" + oplAddr,
80 },
81 &cliClient{c: &cmdx.CommandExecuter{
82 New: func() *cobra.Command {
83 return cmd.NewRootCmd(nil)
84 },
85 Ctx: ctx,
86 PersistentArgs: []string{
87 "--" + cliclient.FlagReadRemote, readAddr,
88 "--" + cliclient.FlagWriteRemote, writeAddr,
89 "--insecure-disable-transport-security=true",
90 "--" + cmdx.FlagFormat, string(cmdx.FormatJSON),
91 },
92 }},
93 &sdkClient{
94 readRemote: readAddr,
95 writeRemote: writeAddr,
96 syntaxRemote: oplAddr,
97 },
98 } {
99 t.Run(fmt.Sprintf("client=%T", cl), runCases(cl, namespaceTestMgr))
100
101 if tc, ok := cl.(transactClient); ok {
102 t.Run(fmt.Sprintf("transactClient=%T", cl), runTransactionCases(tc, namespaceTestMgr))
103 }
104 }
105
106 t.Run("case=metrics are served", func(t *testing.T) {
107 t.Parallel()
108 newGrpcClient(t, ctx,
109 readAddr,

Callers

nothing calls this directly

Calls 9

GetDSNsFunction · 0.92
NewRootCmdFunction · 0.92
newInitializedRegFunction · 0.85
startServerFunction · 0.85
newGrpcClientFunction · 0.85
runCasesFunction · 0.85
runTransactionCasesFunction · 0.85
waitUntilLiveMethod · 0.65
GetMethod · 0.45

Tested by

no test coverage detected