RunTest : Runs a test to create and verify a devfile based on the content of the specified TestContent
(testContent commonUtils.TestContent, t *testing.T)
| 171 | |
| 172 | // RunTest : Runs a test to create and verify a devfile based on the content of the specified TestContent |
| 173 | func 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 | } |