Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for NewFakeContext (0.15 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. istioctl/pkg/describe/describe_test.go

    		}
    	}
    }
    
    func verifyExecAndK8sConfigTestCaseTestOutput(t *testing.T, c execAndK8sConfigTestCase) {
    	t.Helper()
    
    	ctx := cli.NewFakeContext(&cli.NewFakeContextOption{
    		Namespace:      c.namespace,
    		IstioNamespace: c.istioNamespace,
    		Results:        c.configDumps,
    	})
    	client, err := ctx.CLIClient()
    	assert.NoError(t, err)
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Thu Aug 01 20:04:20 UTC 2024
    - 30.8K bytes
    - Viewed (0)
  7. istioctl/pkg/validate/validate_test.go

    			wantError: true, // Since the directory has invalid files
    		},
    	}
    	for i, c := range cases {
    		t.Run(fmt.Sprintf("[%v] %v", i, c.name), func(t *testing.T) {
    			ctx := cli.NewFakeContext(&cli.NewFakeContextOption{
    				IstioNamespace: "istio-system",
    			})
    			validateCmd := NewValidateCommand(ctx)
    			validateCmd.SilenceUsage = true
    			validateCmd.SetArgs(c.args)
    
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Fri Aug 02 16:18:14 UTC 2024
    - 21.4K bytes
    - Viewed (0)
Back to top