mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-04 23:39:33 +08:00
refactor: results dir
This commit is contained in:
@@ -208,7 +208,6 @@ type DriverExt struct {
|
||||
doneMjpegStream chan bool
|
||||
scale float64
|
||||
ocrService OCRService // used to get text from image
|
||||
StartTime time.Time // used to associate screenshots name
|
||||
ScreenShots []string // save screenshots path
|
||||
|
||||
CVArgs
|
||||
@@ -657,8 +656,8 @@ func (dExt *DriverExt) DoAction(action MobileAction) error {
|
||||
case CtlScreenShot:
|
||||
// take snapshot
|
||||
log.Info().Msg("take snapshot for current screen")
|
||||
screenshotPath, err := dExt.ScreenShot(fmt.Sprintf("%d_screenshot_%d",
|
||||
dExt.StartTime.Unix(), time.Now().Unix()))
|
||||
screenshotPath, err := dExt.ScreenShot(fmt.Sprintf("screenshot_%d",
|
||||
time.Now().Unix()))
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "take screenshot failed")
|
||||
}
|
||||
|
||||
@@ -349,9 +349,7 @@ func (dev *IOSDevice) StartPerf() error {
|
||||
return err
|
||||
}
|
||||
|
||||
dev.perfFile = filepath.Join(env.ResultsPath,
|
||||
fmt.Sprintf("perf_%s.log", time.Now().Format("20060102150405")))
|
||||
|
||||
dev.perfFile = filepath.Join(env.ResultsPath, "perf.data")
|
||||
log.Info().Str("perfFile", dev.perfFile).Msg("create perf file")
|
||||
file, err := os.OpenFile(dev.perfFile,
|
||||
os.O_CREATE|os.O_RDWR|os.O_TRUNC, 0o755)
|
||||
@@ -395,9 +393,7 @@ func (dev *IOSDevice) StartPcap() error {
|
||||
return err
|
||||
}
|
||||
|
||||
dev.pcapFile = filepath.Join(env.ResultsPath,
|
||||
fmt.Sprintf("dump_%s.pcap", time.Now().Format("20060102150405")))
|
||||
|
||||
dev.pcapFile = filepath.Join(env.ResultsPath, "dump.pcap")
|
||||
log.Info().Str("pcapFile", dev.pcapFile).Msg("create pcap file")
|
||||
file, err := os.OpenFile(dev.pcapFile,
|
||||
os.O_CREATE|os.O_RDWR|os.O_TRUNC, 0o755)
|
||||
|
||||
Reference in New Issue
Block a user