mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 07:26:55 +08:00
feat: print output with colors
This commit is contained in:
+1
-15
@@ -1,9 +1,6 @@
|
||||
package hrp
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
@@ -25,18 +22,7 @@ func convert2PyTestScripts(paths ...string) error {
|
||||
}
|
||||
|
||||
args := append([]string{"-m", "httprunner", "make"}, paths...)
|
||||
cmd := exec.Command(python3, args...)
|
||||
log.Info().Str("cmd", cmd.String()).Msg("convert to pytest scripts")
|
||||
|
||||
output, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "pytest running failed")
|
||||
}
|
||||
out := strings.TrimSpace(string(output))
|
||||
println(out)
|
||||
|
||||
log.Info().Msg("convert to pytest scripts successfully")
|
||||
return nil
|
||||
return builtin.ExecCommand(python3, args...)
|
||||
}
|
||||
|
||||
func convert2GoTestScripts(paths ...string) error {
|
||||
|
||||
Reference in New Issue
Block a user