(path string)
| 9 | ) |
| 10 | |
| 11 | func LoadJSONCase(path string) (*hrp.TCase, error) { |
| 12 | log.Info().Str("path", path).Msg("load json case file") |
| 13 | caseJSON := new(hrp.TCase) |
| 14 | err := builtin.LoadFile(path, caseJSON) |
| 15 | if err != nil { |
| 16 | return nil, errors.Wrap(err, "load json file failed") |
| 17 | } |
| 18 | |
| 19 | if caseJSON.TestSteps == nil { |
| 20 | return nil, errors.New("invalid json case file, missing teststeps") |
| 21 | } |
| 22 | |
| 23 | err = caseJSON.MakeCompat() |
| 24 | if err != nil { |
| 25 | return nil, err |
| 26 | } |
| 27 | return caseJSON, nil |
| 28 | } |
no test coverage detected