MCPcopy Create free account
hub / github.com/devfile/api / TestMergingOnlyPlugins

Function TestMergingOnlyPlugins

pkg/utils/overriding/merging_test.go:99–116  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

97}
98
99func TestMergingOnlyPlugins(t *testing.T) {
100 baseFile := "test-fixtures/merges/no-parent/main.yaml"
101 pluginFile := "test-fixtures/merges/no-parent/plugin.yaml"
102 resultFile := "test-fixtures/merges/no-parent/result.yaml"
103
104 baseDWT := dw.DevWorkspaceTemplateSpecContent{}
105 pluginDWT := dw.DevWorkspaceTemplateSpecContent{}
106 expectedDWT := dw.DevWorkspaceTemplateSpecContent{}
107
108 readFileToStruct(t, baseFile, &baseDWT)
109 readFileToStruct(t, pluginFile, &pluginDWT)
110 readFileToStruct(t, resultFile, &expectedDWT)
111
112 gotDWT, err := MergeDevWorkspaceTemplateSpec(&baseDWT, nil, &pluginDWT)
113 if assert.NoError(t, err) {
114 assert.Equal(t, &expectedDWT, gotDWT)
115 }
116}
117
118func TestMergingOnlyParent(t *testing.T) {
119 // Reuse only plugin case since it's compatible

Callers

nothing calls this directly

Calls 2

readFileToStructFunction · 0.70

Tested by

no test coverage detected