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

Function RunTest

test/v200/utils/api/test_utils.go:173–191  ·  view source on GitHub ↗

RunTest : Runs a test to create and verify a devfile based on the content of the specified TestContent

(testContent commonUtils.TestContent, t *testing.T)

Source from the content-addressed store, hash-verified

171
172// RunTest : Runs a test to create and verify a devfile based on the content of the specified TestContent
173func RunTest(testContent commonUtils.TestContent, t *testing.T) {
174
175 commonUtils.LogMessage(fmt.Sprintf("Start test for %s", testContent.FileName))
176
177 validator := DevfileValidator{}
178
179 devfileName := testContent.FileName
180 for i := 1; i <= numDevfiles; i++ {
181
182 testContent.FileName = commonUtils.AddSuffixToFileName(devfileName, strconv.Itoa(i))
183
184 testDevfile, err := commonUtils.GetDevfile(testContent.FileName, nil, validator)
185 if err != nil {
186 t.Fatalf(commonUtils.LogMessage(fmt.Sprintf("Error creating devfile : %v", err)))
187 }
188
189 testDevfile.RunTest(testContent, t)
190 }
191}

Callers

nothing calls this directly

Calls 1

RunTestMethod · 0.80

Tested by

no test coverage detected