refactor: TestCase/TestCaseDef/StepConfig models

This commit is contained in:
lilong.129
2024-11-09 20:15:40 +08:00
parent 2587bbee82
commit 8846e84d19
31 changed files with 621 additions and 563 deletions

View File

@@ -14,27 +14,28 @@ type ThinkTime struct {
// StepThinkTime implements IStep interface.
type StepThinkTime struct {
step *TStep
StepConfig
ThinkTime *ThinkTime `json:"think_time,omitempty" yaml:"think_time,omitempty"`
}
func (s *StepThinkTime) Name() string {
return s.step.Name
return s.StepName
}
func (s *StepThinkTime) Type() StepType {
return stepTypeThinkTime
}
func (s *StepThinkTime) Struct() *TStep {
return s.step
func (s *StepThinkTime) Config() *StepConfig {
return &s.StepConfig
}
func (s *StepThinkTime) Run(r *SessionRunner) (*StepResult, error) {
thinkTime := s.step.ThinkTime
thinkTime := s.ThinkTime
log.Info().Float64("time", thinkTime.Time).Msg("think time")
stepResult := &StepResult{
Name: s.step.Name,
Name: s.StepName,
StepType: stepTypeThinkTime,
Success: true,
}