Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for mustCreateEnv (0.45 sec)

  1. staging/src/k8s.io/apiserver/pkg/cel/mutation/env_test.go

    import (
    	"testing"
    
    	"github.com/google/cel-go/cel"
    
    	"k8s.io/apimachinery/pkg/util/version"
    	"k8s.io/apiserver/pkg/cel/environment"
    )
    
    // mustCreateEnv creates the default env for testing, with given option.
    // it fatally fails the test if the env fails to set up.
    func mustCreateEnv(t testing.TB, envOptions ...cel.EnvOption) *cel.Env {
    	envSet, err := environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion(), true).
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 22:07:40 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/cel/mutation/unstructured/typeresolver_test.go

    			expectedValue: true,
    		},
    	} {
    		t.Run(tc.name, func(t *testing.T) {
    			_, option := mutation.NewTypeProviderAndEnvOption(&TypeResolver{})
    			env := mustCreateEnv(t, option)
    			ast, issues := env.Compile(tc.expression)
    			if issues != nil {
    				t.Fatalf("unexpected issues during compilation: %v", issues)
    			}
    			program, err := env.Program(ast)
    			if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 22:07:40 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  3. cluster/gce/gci/configure_helper_test.go

    	}
    }
    
    func (c *ManifestTestCase) mustInvokeFunc(env interface{}, scriptNames []string, targetTemplate string, templates ...string) {
    	envScriptPath := c.mustCreateEnv(env, targetTemplate, templates...)
    	args := fmt.Sprintf("source %q ;", envScriptPath)
    	for _, script := range scriptNames {
    		args += fmt.Sprintf("source %q ;", script)
    	}
    	args += c.manifestFuncName
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Oct 30 06:23:50 UTC 2021
    - 4.8K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/cel/mutation/typeprovider_test.go

    			expectedValue: map[string]any{"spec": map[string]any{"replicas": int64(3)}},
    		},
    	} {
    		t.Run(tc.name, func(t *testing.T) {
    			_, option := NewTypeProviderAndEnvOption(&mockTypeResolver{})
    			env := mustCreateEnv(t, option)
    			ast, issues := env.Compile(tc.expression)
    			if issues != nil {
    				t.Fatalf("unexpected issues during compilation: %v", issues)
    			}
    			program, err := env.Program(ast)
    			if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jan 24 00:01:35 UTC 2024
    - 1.8K bytes
    - Viewed (0)
Back to top