- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 12 for NewFakeContext (0.12 sec)
-
istioctl/pkg/workload/workload_test.go
expectedException: false, expectedOutput: customYAML, }, } for i, c := range cases { t.Run(fmt.Sprintf("case %d %s", i, c.description), func(t *testing.T) { verifyTestcaseOutput(t, Cmd(cli.NewFakeContext(nil)), c) }) } } func verifyTestcaseOutput(t *testing.T, cmd *cobra.Command, c testcase) { t.Helper() var out bytes.Buffer cmd.SetArgs(c.args) cmd.SetOut(&out) cmd.SetErr(&out)
Registered: Wed Nov 06 22:53:10 UTC 2024 - Last Modified: Thu Aug 01 20:04:20 UTC 2024 - 14.6K bytes - Viewed (0) -
istioctl/pkg/metrics/metrics_test.go
WantException: true, }, { // case 1 Args: strings.Split("details", " "), ExpectedOutput: "Error: no Prometheus pods found\n", WantException: true, }, } metricCmd := Cmd(cli.NewFakeContext(nil)) for i, c := range cases { t.Run(fmt.Sprintf("case %d %s", i, strings.Join(c.Args, " ")), func(t *testing.T) { testutil.VerifyOutput(t, metricCmd, c) }) } } func TestMetrics(t *testing.T) {
Registered: Wed Nov 06 22:53:10 UTC 2024 - Last Modified: Fri Aug 16 01:35:47 UTC 2024 - 8K bytes - Viewed (0) -
istioctl/pkg/proxyconfig/proxyconfig_test.go
wantException: true, }, } for i, c := range cases { t.Run(fmt.Sprintf("case %d %s", i, strings.Join(c.args, " ")), func(t *testing.T) { verifyExecTestOutput(t, ProxyConfig(cli.NewFakeContext(&cli.NewFakeContextOption{ Results: c.execClientConfig, Namespace: "default", })), c) }) } } func verifyExecTestOutput(t *testing.T, cmd *cobra.Command, c execTestCase) {
Registered: Wed Nov 06 22:53:10 UTC 2024 - Last Modified: Wed Apr 10 21:51:29 UTC 2024 - 8.9K bytes - Viewed (0) -
istioctl/pkg/waypoint/waypoint_test.go
makeGatewayWithRevision("bookinfo-rev", "bookinfo", true, true, "rev1"), }, expectedOutFile: "combined-gateway", }, } for _, tt := range cases { t.Run(tt.name, func(t *testing.T) { ctx := cli.NewFakeContext(&cli.NewFakeContextOption{ Namespace: "default", }) client, err := ctx.CLIClient() if err != nil { t.Fatal(err) } for _, gw := range tt.gateways {
Registered: Wed Nov 06 22:53:10 UTC 2024 - Last Modified: Thu Apr 04 15:53:09 UTC 2024 - 4.4K bytes - Viewed (0) -
istioctl/pkg/precheck/precheck_test.go
// minor <= 21 and checkTracing failing } for _, c := range cases { t.Run(fmt.Sprintf("revision=%s, version=%s", c.revision, c.version), func(t *testing.T) { ctx := cli.NewFakeContext(&cli.NewFakeContextOption{ IstioNamespace: "istio-system", }) output, err := checkFromVersion(ctx, c.revision, c.version) assert.Equal(t, output, c.expectedOutput) if c.expectedError != nil {
Registered: Wed Nov 06 22:53:10 UTC 2024 - Last Modified: Tue Jul 09 12:01:22 UTC 2024 - 3.9K bytes - Viewed (0) -
istioctl/pkg/internaldebug/internal-debug_test.go
} t.Cleanup(func() { multixds.GetXdsResponse = xds.GetXdsResponse }) for i, c := range cases { t.Run(fmt.Sprintf("case %d %s", i, strings.Join(c.args, " ")), func(t *testing.T) { ctx := cli.NewFakeContext(&cli.NewFakeContextOption{ IstioNamespace: "istio-system", }) if !c.noIstiod { client, err := ctx.CLIClientWithRevision(c.revision) assert.NoError(t, err)
Registered: Wed Nov 06 22:53:10 UTC 2024 - Last Modified: Fri Mar 15 08:28:50 UTC 2024 - 4.5K bytes - Viewed (0) -
istioctl/pkg/ztunnelconfig/ztunnelconfig_test.go
wantException: false, }, } for i, c := range cases { t.Run(fmt.Sprintf("case %d %s", i, strings.Join(c.args, " ")), func(t *testing.T) { verifyExecTestOutput(t, ZtunnelConfig(cli.NewFakeContext(&cli.NewFakeContextOption{ Results: c.execClientConfig, Namespace: "default", })), c) }) } } func verifyExecTestOutput(t *testing.T, cmd *cobra.Command, c execTestCase) { t.Helper()
Registered: Wed Nov 06 22:53:10 UTC 2024 - Last Modified: Wed Apr 10 21:51:29 UTC 2024 - 3.8K bytes - Viewed (0) -
istioctl/pkg/proxystatus/proxystatus_test.go
} t.Cleanup(func() { multixds.GetXdsResponse = xds.GetXdsResponse }) for i, c := range cases { t.Run(fmt.Sprintf("case %d %s", i, strings.Join(c.args, " ")), func(t *testing.T) { ctx := cli.NewFakeContext(&cli.NewFakeContextOption{ IstioNamespace: "istio-system", }) if !c.noIstiod { client, err := ctx.CLIClientWithRevision(c.revision) assert.NoError(t, err)
Registered: Wed Nov 06 22:53:10 UTC 2024 - Last Modified: Fri Mar 15 08:28:50 UTC 2024 - 5.5K bytes - Viewed (0) -
istioctl/pkg/multicluster/remote_secret_test.go
// ClusterName: testCluster, KubeOptions: KubeOptions{ Namespace: testNamespace, }, Type: c.secType, SecretName: c.secretName, } ctx := cli.NewFakeContext(&cli.NewFakeContextOption{ IstioNamespace: "istio-system", Objects: c.objs, Namespace: testNamespace, Version: c.k8sMinorVersion, }) client, err := ctx.CLIClient()
Registered: Wed Nov 06 22:53:10 UTC 2024 - Last Modified: Thu Oct 24 17:36:49 UTC 2024 - 20.7K bytes - Viewed (0) -
istioctl/pkg/cli/context.go
Results map[string][]byte // Objects are the objects to be applied to the fake client Objects []runtime.Object // Version is the version of the fake client Version string } func NewFakeContext(opts *NewFakeContextOption) Context { if opts == nil { opts = &NewFakeContextOption{} } ns := opts.Namespace ins := opts.IstioNamespace return &fakeInstance{ clients: map[string]kube.CLIClient{},
Registered: Wed Nov 06 22:53:10 UTC 2024 - Last Modified: Wed Oct 23 19:31:32 UTC 2024 - 8.9K bytes - Viewed (0)