mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-07 08:49:37 +08:00
feat: record execution data for report #25
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"github.com/httprunner/hrp"
|
||||
"github.com/httprunner/hrp/internal/builtin"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -32,11 +33,11 @@ func removeHashicorpPlugin() {
|
||||
|
||||
func TestGenDemoTestCase(t *testing.T) {
|
||||
tCase, _ := demoTestCase.ToTCase()
|
||||
err := tCase.Dump2JSON(demoTestCaseJSONPath)
|
||||
err := builtin.Dump2JSON(tCase, demoTestCaseJSONPath)
|
||||
if err != nil {
|
||||
t.Fail()
|
||||
}
|
||||
err = tCase.Dump2YAML(demoTestCaseYAMLPath)
|
||||
err = builtin.Dump2YAML(tCase, demoTestCaseYAMLPath)
|
||||
if err != nil {
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
"github.com/httprunner/hrp/internal/builtin"
|
||||
"github.com/httprunner/hrp/internal/ga"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
@@ -48,12 +49,12 @@ func CreateScaffold(projectName string) error {
|
||||
|
||||
// create demo testcases
|
||||
tCase, _ := demoTestCase.ToTCase()
|
||||
err := tCase.Dump2JSON(path.Join(projectName, "testcases", "demo.json"))
|
||||
err := builtin.Dump2JSON(tCase, path.Join(projectName, "testcases", "demo.json"))
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("create demo.json testcase failed")
|
||||
return err
|
||||
}
|
||||
err = tCase.Dump2YAML(path.Join(projectName, "testcases", "demo.yaml"))
|
||||
err = builtin.Dump2YAML(tCase, path.Join(projectName, "testcases", "demo.yaml"))
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("create demo.yml testcase failed")
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user