updates to execute func in integration-test.go

dev
LuitelSamikshya 2022-10-13 11:05:10 -05:00
parent 2456121e1a
commit 909aa4cd79
1 changed files with 4 additions and 4 deletions

View File

@ -62,7 +62,7 @@ func runTests(customTemplatePaths map[string]struct{}) map[string]struct{} {
for templatePath, testCase := range testCases {
if len(customTemplatePaths) == 0 || contains(customTemplatePaths, templatePath) {
if err, failedTemplatePath := execute(testCase, templatePath); err != nil {
if failedTemplatePath, err := execute(testCase, templatePath); err != nil {
failedTestTemplatePaths[failedTemplatePath] = struct{}{}
}
}
@ -72,14 +72,14 @@ func runTests(customTemplatePaths map[string]struct{}) map[string]struct{} {
return failedTestTemplatePaths
}
func execute(testCase testutils.TestCase, templatePath string) (error, string) {
func execute(testCase testutils.TestCase, templatePath string) (string, error) {
if err := testCase.Execute(templatePath); err != nil {
_, _ = fmt.Fprintf(os.Stderr, "%s Test \"%s\" failed: %s\n", failed, templatePath, err)
return err, templatePath
return templatePath, err
}
fmt.Printf("%s Test \"%s\" passed!\n", success, templatePath)
return nil, ""
return "", nil
}
func expectResultsCount(results []string, expectedNumber int) error {