(t *testing.T)
| 130 | } |
| 131 | |
| 132 | func TestCatchesNonExistentExternalDWOC(t *testing.T) { |
| 133 | setupForTest(t) |
| 134 | |
| 135 | workspace := &dw.DevWorkspace{} |
| 136 | attributes := attributes.Attributes{} |
| 137 | namespacedName := types.NamespacedName{ |
| 138 | Name: "external-config-name", |
| 139 | Namespace: "external-config-namespace", |
| 140 | } |
| 141 | attributes.Put(constants.ExternalDevWorkspaceConfiguration, namespacedName, nil) |
| 142 | workspace.Spec.Template.DevWorkspaceTemplateSpecContent = dw.DevWorkspaceTemplateSpecContent{ |
| 143 | Attributes: attributes, |
| 144 | } |
| 145 | client := fake.NewClientBuilder().WithScheme(scheme).Build() |
| 146 | |
| 147 | resolvedConfig, err := ResolveConfigForWorkspace(workspace, client) |
| 148 | if !assert.Error(t, err, "Error should be given if external DWOC specified in workspace spec does not exist") { |
| 149 | return |
| 150 | } |
| 151 | assert.Equal(t, resolvedConfig, internalConfig, "Internal/Global DWOC should be used as fallback if external DWOC could not be resolved") |
| 152 | } |
| 153 | |
| 154 | func TestMergeExternalConfig(t *testing.T) { |
| 155 | setupForTest(t) |
nothing calls this directly
no test coverage detected