MCPcopy Create free account
hub / github.com/devfile/devworkspace-operator / setupForTest

Function setupForTest

pkg/config/common_test.go:52–66  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

50}
51
52func setupForTest(t *testing.T) {
53 if err := os.Setenv("WATCH_NAMESPACE", testNamespace); err != nil {
54 t.Fatalf("failed to set up for test: %s", err)
55 }
56 infrastructure.InitializeForTesting(infrastructure.Kubernetes)
57 setDefaultPodSecurityContext()
58 setDefaultContainerSecurityContext()
59 setDefaultOverrideConfig()
60 configNamespace = testNamespace
61 originalDefaultConfig := defaultConfig.DeepCopy()
62 t.Cleanup(func() {
63 internalConfig = nil
64 defaultConfig = originalDefaultConfig
65 })
66}
67
68func buildConfig(config *v1alpha1.OperatorConfiguration) *v1alpha1.DevWorkspaceOperatorConfig {
69 return &v1alpha1.DevWorkspaceOperatorConfig{

Calls 5

InitializeForTestingFunction · 0.92
setDefaultOverrideConfigFunction · 0.85
DeepCopyMethod · 0.45

Tested by

no test coverage detected