mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-25 17:44:02 +08:00
fix: return error when testcase count less than 1
This commit is contained in:
@@ -1 +1 @@
|
||||
v4.3.7.2311301111
|
||||
v4.3.7
|
||||
@@ -53,6 +53,7 @@ func LoadTestCases(iTestCases ...ITestCase) ([]*TestCase, error) {
|
||||
testCasePath := TestCasePath(path)
|
||||
tc, err := testCasePath.ToTestCase()
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("fail to parse test:")
|
||||
return nil
|
||||
}
|
||||
testCases = append(testCases, tc)
|
||||
@@ -63,6 +64,10 @@ func LoadTestCases(iTestCases ...ITestCase) ([]*TestCase, error) {
|
||||
}
|
||||
}
|
||||
|
||||
if len(testCases) < 1 {
|
||||
return nil, errors.New("test case count less than 1 or parse error")
|
||||
}
|
||||
|
||||
log.Info().Int("count", len(testCases)).Msg("load testcases successfully")
|
||||
return testCases, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user